I decided to (yet again) use Dark Basic Pro, i'm still a little in C++ and there could be accidental C++/Allegro in my code that might be the problem as i have gone totally upside down with these, but into the problem. I have set a FUNCTION that determines what happens when i press something.
Function Idle()
hide all sprites
sprite 1,xPos,yPos,1
show sprite 1
play sprite 1,1,6,100
xPos=xPos
c=1
sync
endfunction
Function GoRight()
do
hide all sprites
sprite 2,xPos,yPos,1
show sprite 2
play sprite 2,1,6,50
xPos=xPos+3
c=2
if rightkey()=0
Idle()
endif
sync
loop
EndFunction
Function GoLeft()
Do
hide all sprites
sprite 4,xPos,yPos,1
show sprite 4
play sprite 4,1,6,50
xPos=xPos-3
c=4
if leftkey()=0
Idle()
endif
sync
Loop
EndFunction
that code above is from my Function part
i dunno what is wrong here but heres my code for the main loop
xPos=1
yPos=60
sync rate 30
play music 1
backdrop on
color backdrop rgb (0,0,255)
sync
do
Idle()
if rightkey()=1: GoRight()
if leftkey()=1: GoLeft()
endif
endif
loop
Thought of posting this before i gosub sleep
sleep:
print "because it is 2:47 A.M here"
Good night ya'll and thanks
EDIT: oh and almost forgot, i use sprite sheets and .bmp
thanks again