controlling animation
I started learning OpenGl only about a month ago so im fairly new to game programming. I''m working on a tennis game, i thought i''d start it out like a professional so i spent some time on the design stage. i got stuck in the part where im supposed to control the animations such as the player swinging the raquet or the motion of the ball. Everything in my design is in classes, the players, the raquets and the ball so i just have to call player.xposition for example, which has a glTranslatef() to move the player left or right but otherwise in an animation if I added a player.animateswing() function all the other objects in the game will stop moving and only the swinging movement will animate. If u know any known design strategies that i should follow that u think will solve my problem it would be appreciated if u post them soon so i could continue my work on the project.
Thx
Export animation formats from 3DS Max and then handle those. Ofcourse you get to visually design the animations yourself.
This post will self-destruct in 5 seconds...Actually, it's just Benjamin Bunny doing his thing.
One trick if you''ve got to control lots of animation is to have a few arrays of frame numbers. You might have swinging the racket 1,2,3 or running 1,4,5,1,4,5,1,4,5 etc.
Each loop, check the current frame and just move to the next. Put some sort of current-anim-sequence variable in there that you can change when you need to change what animation you want to play. You could add ''loop'' points for cyclic animation too. This system should be good enough for almost anything, a beat em up for example.
Mark
Cornutopia Games
http://www.cornutopia.net
Bytten Independent Games Magazine
http://www.bytten.com
Each loop, check the current frame and just move to the next. Put some sort of current-anim-sequence variable in there that you can change when you need to change what animation you want to play. You could add ''loop'' points for cyclic animation too. This system should be good enough for almost anything, a beat em up for example.
Mark
Cornutopia Games
http://www.cornutopia.net
Bytten Independent Games Magazine
http://www.bytten.com
thx mark. i think i got ur point, ive once thought of doing something similar but didnt know how to implement it and i also thought there was some kind of common method that everyone goes by as almost every game has animations. thx again.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement