try this:
rem make some sprites and position them
cls rgb(255,0,0)
get image 1,0,0,32,32,1
cls rgb(0,255,0)
get image 2,0,0,32,32,1
x1 = (screen width()/2) - 64
x2 = (screen width()/2) + 64
y = screen height()/2
sprite 1,x1,y,1
offset sprite 1,16,16
sprite 2,x2,y,2
offset sprite 2,16,16
rem use a toggle switch to swap between visible sprites
toggle = -1
lasttoggletime = timer()
do
rem flip the switch every 2 seconds
if lasttoggletime + 2000 < timer()
toggle = toggle * -1
lasttoggletime = timer()
endif
rem toggle the sprites
if toggle = -1
hide sprite 1
show sprite 2
else
show sprite 1
hide sprite 2
endif
rem screen stuff :)
text 0,0,str$(screen fps())
text 0,12,str$(toggle)
loop
edit: i changed the variable name that holds the last time the switch was flipped to something more appropriate so it wasn't misleading.
i also want to point out that in your original code, you re-set x incorrectly by setting x
# to 0 so, in essence, you never re-set the variable; x kept increasing well beyond 80.
Virtual Nomad @ California, USA
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit