The function beginGame() has bluePlane() within it. With the following code, the plane is now annimated.
do
mainMenu()
if GetPointerPressed()=1 and GetTextHitTest (gameStart,GetPointerX (),GetPointerY ())
PlayMusic(taptap)
backdrop = createsprite(10)
SetSpritePosition(backdrop,screenW,0)
SetViewOffset(screenW,0)
beginGame()
endif
sync()
loop
Problem i'm having now is: I have the MainMenu() function, which loads within the first screen. When you click 'Game Start', the game jumps to SetViewOffset(screenW,0) which is the screen to the right. The plane loads, it's animated, and i have a new backdrop. Now, i can't get my plane to respond to my controls, and i've tried everything. If i kept my plane on the first screen (Setviewoffset(0,0) the plane works with the following code:
setspriteposition(1, x, y)
x=x+GetDirectionX()*speed
y=y+GetDirectionY()*speed
if getspritex(1) + getspritewidth(1) > screenW
x = screenW - getspritewidth(1)
setspritex(1, x)
endif
if getspritex(1) < 0
x=0
setspritex(1,x)
endif
if getspritey(1) + GetSpriteHeight(1) > screenH
y = screenH - GetSpriteHeight(1)
setspritey(1, y)
endif
if getspritey(1) < 0
y=0
setspritey(1, y)
endif
I know it's something to do with the setspriteposition, but i'm unsure how to get the controls to work on the following screen. Please help.
Khadin