[SDL] Quick Question about animation

Patricia Curtis patricia.curtis at gmail.com
Thu Mar 8 06:21:04 PST 2007


>>I'll give this a try so basically all its doing is loading the 2
>>images in an array so when I call the key events I tell the array to
>>do an infinite array of 2 frames back and forth
 
Yeah just load the images into an array of 2 then when you blit cycle
through the array using the bit wise mask on the AnimationFrameCounter,
obviously this is only for a very simple two frame animation but Bit
wising will save you loads of If / switch statments , BTW i where ever i
can i use numbers that can be bit wised as a simple and will save loads of
time and checking. 
 
&1 = 0-1  (2 Frames)
&3 = 0-3  (4 Frames)
&7 = 0-7 .(8 Frames) ...and so on.
 
Trish x
 
 
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 6319 bytes
Desc: not available
Url : http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070308/f4c10d81/attachment.bin 


More information about the SDL mailing list