In need of the right strategy for animations

Blitz3D Forums/Blitz3D Programming/In need of the right strategy for animations

soniclife(Posted 2004) [#1]
Please imagine the following:

I wanna do a boardgame with Smileys as figures. The board is 9x9 - so I need max. 81 Smileys. They should have eyes which could be scaled and moved plus moving pupils. Their mouths also should be animated. PLUS: The Smilies are rotating and scaling and stuff as a whole.
Would it be better to "animate" the textures (for sure for every single figure) or would you place the components as individual entities?
Any suggestions (performance-wise)? THANKS!


_PJ_(Posted 2004) [#2]
Are they going to be actual 3D objects or sprites - It sounds like your boardgame is going to be 2D (even if viewed in 3D) so Sprites may be simpler.

I would approach this by having one image containing the whole series of animations for the sprites. Texture the sprites each with this image.

Then, assign a special variable to each smiley, which determines which animation sequence it is running.

For instance:

For Update.Smileys = Each Smileys

Update\Animation = Update\Animation + 1
If Update\Animation > 8 then Update\Animation = 0

BrushTexture anim_brush,anim_texture,(Update\Animframe + (Update\Sequence*9))
PaintEntity Update\Sprite,anim_brush

Next


------------------

In this example, the smileys are all stored as Types, the animation sequence image is loaded as a texture called anim_texture, and each sequence is 9 frames long. You can select the sequence with 'Sequence' Field, then the actual frame (Animframe Field) will increment each loop.

Sorry, I know my explanation isnt that good. Its late and Im about to go to bed... If you still need more info, Il get back tomorrow.

(Oh anyone else, feel free to embellish I know my code's not the most efficient - at least a Mod command should be in there somewhere...) :)