ok... I'm not shure what I'm doing wrong but the compiler keeps telling me "could not understand command at line 51"
its ths line:
if Dirx# > 0.5
waklingright()
endif
am I calling the function wrong or did I do my function wrong
hears my code;
main
//
rem AGK Application
rem AGK Build 107
//
// Project# 002
// version 1.0
// Last Revised 12-30-12
rem Landscape App
SetDisplayAspect( 4.0/3.0 )
SetVirtualResolution (640 , 480 )
rem background
backdrop = CreateSprite ( LoadImage ( "testbackground1.png" ) )
rem load music into ID slot 1
LoadMusic ( 1, "01 Footsteps FX.mp3" )
rem Set Sprite variables X&Y
X#=23.00
Y#=344.9
rem create sprite
CreateSprite ( 1, 0 ) // create a sprite with ID that has no image
SetSpriteOffset(1, getspritewidth(1)/2 , getspriteheight(1)/2 ) // sets sprites X&Y to center
SetSpritePosition ( 1, x#, y# )
rem add individual images into an animation list for Sprite 1
AddSpriteAnimationFrame ( 1, LoadImage ( "Godzilla_rws1b.png" ) )
AddSpriteAnimationFrame ( 1, LoadImage ( "Godzilla_rws2b.png" ) )
AddSpriteAnimationFrame ( 1, LoadImage ( "Godzilla_rws3b.png" ) )
AddSpriteAnimationFrame ( 1, LoadImage ( "Godzilla_rws4b.png" ) )
AddSpriteAnimationFrame ( 1, LoadImage ( "Godzilla_rws5b.png" ) )
AddSpriteAnimationFrame ( 1, LoadImage ( "Godzilla_rws6b.png" ) )
rem play the animated sprite
PlaySprite ( 1, 10, 0, 1, 6 )
rem play and loop the music
PlayMusic ( 1, 1 )
rem Main Program Loop
do
rem show debug statistics for X and Y
print(" X position = " + str ( GetSpriteX(1)))
rem get input and move sprite
Dirx# = GetDirectionX()
Diry# = GetDirectionY()
if Dirx# > 0.5
walkingright(X#, Y#)
endif
Sync()
loop
function
//
rem FUNCTIONS
//
rem walking right function
FUNCTION walkingright (X#, Y# )
rem play the animated sprite
PlaySprite ( 1, 10, 1, 1, 6 )
Sync()
rem Walking Loop
while (Dirx# > 0.5)
Dirx# = GetDirectionX()
x# = x# + 1.0
setspriteposition(1,x#,y#) // update sprite position
rem show debug statistics for X and Y
print(" X position = " + str ( GetSpriteX(1)))
Sync()
endwhile
PlaySprite ( 1, 10, 0, 1, 6 )
sync()
endfunction
*EDIT
code updated