Hey,
I've coded a little program that moves a box across the bottom of the screen.
When the box gets to the edges I would like it to stop, but it disappears off of the screen and then reappears on the screen where it was meant to have stopped and won't move off the screen.
Here's the code to move the box and check where it is on screen,
REM If the left key is pressed then move the box left until it hits the end of the screen when it should stop
IF LEFTKEY()= 1
L#=L#-S#
R#=R#-S#
IF L#<=0.0
L#=0.0
R#=50.0
ENDIF
ENDIF
REM If the right key is pressed then move the box right until it hits the end of the screen when it should stop
IF RIGHTKEY()= 1
L#=L#+S#
R#=R#+S#
IF R#>=480.0
R#=480.0
L#=430.0
ENDIF
ENDIF
I believe the code is correct but I can't understand why it disappears the first time, check source for full code.
Is my code correct?
Is there a better way to check?
Cheers
Stedders
Are Games getting worse or our standards getting higher?