Posted: 4th Sep 2011 14:58
Hi everyone
I can't get my sprite to animated in this sequence ..
+ Code Snippet
SetVirtualResolution ( 1024,600 )
Loadimage (1,"Menu-En.png")
Createsprite (1,1)
Setspriteanimation (1,339,93,6)
Do
Playsprite (1,8,1)
Sync ()
Loop

The image loaded contains a sprite sheet with 6 animation in vertical.
I only can see the first frame of the sprite but it can't get animated .. i have missed something ?
Posted: 4th Sep 2011 17:18
Without testing, I would suggest you move your PlaySprite command above the loop start, as each time you call it, it is restarting the animation at frame 1. You don't have to have the play command inside the DO loop, it runs by itself.
Posted: 5th Sep 2011 16:28
Ohh that fool I am! I'm too used to DBPro where the play command need to be inside a loop to animate a sprite , I had forgotten that in AppGameKit the playsprite command is automatic!
Thank you a lot
Posted: 5th Sep 2011 19:21
Doesn't DB do the same thing if you play a sprite in a loop? I didn't use the animated sprite commands in DB, so can't quite remember. You had to place you sprite in the loop, but play it from another routine, else it would constantly play frame 1. AppGameKit just negates the need of placement, unless you want it to move while in the loop.
Posted: 6th Sep 2011 0:03
Not exactly DVader, now i remember that in AppGameKit the Playsprite command is automatic once written, so you have only to write a Sync command to show next frame, so this code
+ Code Snippet
Playsprite (X,...)
Do : Sync(): Loop

show the sprite animated, instead in DBPro you have to write this code
+ Code Snippet
Do
Playsprite (X...)
Sync
Loop

to animating the sprite.