Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 24 Oct 2012
Offline Last Active May 24 2015 10:00 PM

Topics I've Started

Sequence animation by codes or using .gif image

14 May 2015 - 10:45 PM


I'm working on 2D air shooting (using c++), idea is something like 1943 or Gradius.

Basically, player moving around up, down, left & right, shoot bullets to enemy, and enemy shoot too.
It works find, and now i'm in modif & fix-up things.

The ship movement animate some sprites, following the direction button hit by player.
If moving up, then i animate the up-movement sprites,
about 4 images within some(1 or 1.5) seconds, as long the player hold the up-button.
Same on with moving left, i play the left-movement sprites,
also the behavior for moving right & down.

And now i have this in mind:
1. I will stick to play animation sequence using program(codes) everytime player push the button.
2. Should i change, by prepare 4 images(up, down, left, right) in gif format,
which is each image already play their own frame sequence as i setup from image designer tool

(not to play the sequence by codes)

I'm thinking about:
- Memory consumption when game is running, overall, regarding player's directional movement.
- Game modification (if someday i need to change/add the sprites, sequences, etc... related to efficiency or practically)

Does anybody have opinion ? 

smile.png Thanks.

C++ Function Parameter

31 October 2012 - 12:11 AM

i'm currently in practice with c++, i found a situation(not critical).

as i read from tutorial & article, it said that good thing in passing argument by reference, but not to change the value inside the function, is to use the constant-references as the function parameter.

in situation that i just want to pass the argument to a function just for resource only, not to change the value itself,
1. so when is the right time to use the by-value parameter ?
2. when is the time not to use the constant-references parameter ?

may anyone have suggestion..

thank you,
happy coding Posted Image