IKA: ANIMATIONS/FRAMES
Posts
Pages:
1
Whenever a animation is cast like.
anim.makeAnim(range(number,number),number)
Does anyone have a distinct tutorial for animations? It's all mumbo jumbo to me.
anim.makeAnim(range(number,number),number)
Does anyone have a distinct tutorial for animations? It's all mumbo jumbo to me.
As SDHawk said in #ika, that is a custom animation system.
To be more specific about writing an animation system, you'll basically want a sprite object. Said object should have an array of images for each frame (ideally, you'd load a single image file and splice it down to each frame using surfaces but you can use single image files for each frame for testing purposes). You'd then want a Draw function in the sprite object that calls something like:
self.MyImages.Draw(self.x, self.y)
Where self.Frame is a number representing which frame is currently being drawn.
Next you'd want an Update function that increments the frame number with a slight delay. You'd also want it to decide which frame number it starts incrementing from based on the direction it's facing, so have a Direction property as well. You'd probably want a dictionary of lists containing the frame list for each direction. ie,
MyFrames = { 'left': , 'right': }
then turn your drawing function into:
self.MyImages[ self.MyFrames ].Draw( self.x, self.y)
Presto, you have animation!
See the 3 part tutorial on the ika website for how to create a basic Sprite object and get it drawn/updated.
Alternatley you could use the built-in sprite system ika has, try finding the rho software (PROBABLY included with ika) to import stuff. It's a beta and somewhat broken but workable.
self.MyImages.Draw(self.x, self.y)
Where self.Frame is a number representing which frame is currently being drawn.
Next you'd want an Update function that increments the frame number with a slight delay. You'd also want it to decide which frame number it starts incrementing from based on the direction it's facing, so have a Direction property as well. You'd probably want a dictionary of lists containing the frame list for each direction. ie,
MyFrames = { 'left': , 'right': }
then turn your drawing function into:
self.MyImages[ self.MyFrames ].Draw( self.x, self.y)
Presto, you have animation!
See the 3 part tutorial on the ika website for how to create a basic Sprite object and get it drawn/updated.
Alternatley you could use the built-in sprite system ika has, try finding the rho software (PROBABLY included with ika) to import stuff. It's a beta and somewhat broken but workable.
Thanks, now if only I can play ika games on vista.. pre-made games work fine under XP, the game I made works fine on both.
Upgrading to windows 7 beta.
Upgrading to windows 7 beta.
Hope you only like your OS to run for exactly 5 months.
Pages:
1















