Animation won't work

BlitzPlus Forums/BlitzPlus Programming/Animation won't work

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

graphics 800,600,0,2
playerImage=loadanimImage("ship_idle.bmp",80,70,0,4)
type UnitObject ;just some name for your type so that this code snippet works

field frame
field image
end type
player1.unitobject=new unitobject
player1\image=playerimage
player1\frame=0
repeat


cls
player1\frame=(player1\frame +1) mod 4 ;frames go from 0-3, meaning there are 4 frames in total with the first being frame 0 and the last being frame 3
drawimage player1\image,400,300,player1\frame

flip

until keydown(1)
freeimage playerImage
delete each unitobject
end




should get you started.