I have a very beginner question. But I never found how to do it
I have a character that can be left and right.
To the right are sprites 1-8
To the left are sprites 9-16
But I must to put
PlaySprite before the LOOP.
But when I want to animate the character to the left, ie. sprites 9-16, how do I do? Next PlaySprite I can not put... Thanks in advance!
// set window properties
SetWindowTitle("animace geko")
SetWindowSize(1024,768,0)
SetVirtualResolution(480,320)
SetOrientationAllowed(1,1,1,1)
CreateSprite(LoadImage("blueSky.png")) // pozadí
geko1=CreateSprite(0) // vytvoření sprite
//načtení celé sekvence
for i=1 to 16
AddSpriteAnimationFrame(geko1,LoadImage(str(i)+".png"))
next i
// a virtual joystick
AddVirtualJoystick(1,40,280,53)
global joystickX#,joystickY#
global x#,y#
x#=110
y#=100
SetSpritePosition(geko1,x#,y#)
PlaySprite(geko1,10,1,1,8)
// main loop
do
// get input from joystick
joystickX#=GetVirtualJoystickX(1)
joystickY#=GetVirtualJoystickY(1)
// play animation
if joystickX#>0
x#=x#+joystickX#
SetSpritePosition(geko1,x#,y#)
endif
sync()
loop
I am sorry for poor English