View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Animation

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

### #1ZeroRage  Members

Posted 15 July 1999 - 05:32 AM

I am attempting to go about with my first game. Rather than going full blown into a 3d game, i want to make a 2d game and am wondering about animation. Dirty rectangle, double buffering, page flipping, these are all fine, but I am having a difficult time deciding how to implement the different levels of animation. Example say the main character is standing there going thru the anim. Now the player hits the left arrow (or whatever moves him left), how do I make it so that the longer the button is held, the faster the character moves, and with speed changes animations. I was think about as the speed increases, there would be a limit for each set of animations, say if character speed is > 20, use the second set,
if > 30, use third set, etc. Just want to know if anyone more experienced has some better solution that would like to spread the knowledge???

### #2Akura  Members

Posted 15 July 1999 - 05:32 AM

well one way is to set a timer and check for a key press every XX miliseconds. Each time the timer beeps (gets to the desire time) it reduces the speed by 1 and every key press (should be checked in the same interval as before) 2 values are added to speed so you will have a linear accelaration, and you can do like

[PSEUDO CODE]

if direction = LEFT

if keypressed = RIGHT

then

speed = speed - 2

if keypressed = LEFT

then

speed = speed + 1

end if

speed = speed - 1
[PSEUDO CODE OVER]

just a suggestion, if you want realistic movement, like car movement or something just let me know and i'll explain

bye

------------------
Bruno Sousa aka Akura
Founder and programmer - Magick.pt
[mail]magick_pt@geocities.com[/mail]
http://magickpt.cjb.net

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.