Hey guys I\'m new at this and I was playing around with sprites. I\'m trying to make it so when I press the left or right arrow the sprite will go in that direction but when I run the program the sprite just disappears when I press an arrow. But if I put a print command in each of the while statements it works. Can someone tell me whats wrong so I dont have to put in those prints or maybe show me a better way of doing this. I know this is problably a newb way of doing this so dont go to hard on me.
Thanks
INK rgb(244,214,210),1
LOAD bitmap \"face.bmp\"
SET current bitmap 0
GET image 1,18,17,156,196
SPRITE 1,100,100,1
CLS
REM sprite is starting from the left
spriteacross=100
REM sprite is in the middle level
spritelevel=150
DO
REM makes the sprite walk right
WHILE rightkey()=1 AND controlkey()=0
spriteacross=spriteacross+1
SPRITE 1,spriteacross,spritelevel,1
REM it won\'t work without this print. why?
PRINT
ENDWHILE
REM makes the sprite walk left
WHILE leftkey()=1 AND controlkey()=0
spriteacross=spriteacross-1
SPRITE 1,spriteacross,spritelevel,1
REM it won\'t work without this print. why?
PRINT
ENDWHILE
REM makes the sprite run right
WHILE rightkey()=1 AND controlkey()=1
spriteacross=spriteacross+3
SPRITE 1,spriteacross,spritelevel,1
REM it won\'t work without this print. why?
PRINT
ENDWHILE
REM makes the sprite run left
WHILE leftkey()=1 AND controlkey()=1
spriteacross=spriteacross-3
SPRITE 1,spriteacross,spritelevel,1
REM it won\'t work without this print. why?
PRINT
ENDWHILE
SPRITE 1,spriteacross,spritelevel,1
PRINT
LOOP