Skip to main content
GameDev.net gamedev.net
🔒 Locked

Animate Question

Started by Pintu May 2, 2004 at 6:59 AM 0 replies 250+ views
Original Post
Pintu
Pintu
I want an object to perform a movement when the user presses a key (for example rotating 90 degrees around the y-axis). I code the process like this: I define a bool variable which yields for ''animate'' when TRUE, and (default) ''stop'' when FALSE. When the user presses the key, the bool var is set TRUE, so the animation will start next frame. At the same time, ever frame, the bool variable is controlled whether it''s TRUE or not. If TRUE, the anim starts, a glRotatef function with an angle counter which is increased every frame. And if the (angle==90) the bool variable is set FALSE. This works but I don''t think that it''s a good way to animate things in a big program which has lots of objects doing lots of things. For example if I have possible 50 animations, every frame I control if any of them has been started. Isn''t there a way to tell program the animation only when requested? Some of my friends told me "they use timers". Please tell me a better way. Thanks

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.