Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


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.

  • You cannot reply to this topic
1 reply to this topic

#1 ZeroRage   Members   -  Reputation: 122

Like
Likes
Like

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???


Sponsor:

#2 Akura   Members   -  Reputation: 130

Like
Likes
Like

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.



PARTNERS