Currently my player will stop when colliding with the object but the background continues to scroll. My question is how would i get the background to stop as well?
Thank you for any help you can give.
rem load a player image
loadimage ( 1, "skeleton_walk_001.png" )
createsprite ( 1, 1 )
setspriteanimation ( 1, 64, 64, 48 )
setspriteposition ( 1, 140, 200 )
setspritedepth ( 1, 100 )
setspriteshape ( 1, 1 )
rem load image of the floor
loadimage ( 2, "floor_001.jpg" )
createsprite ( 2, 2 )
setspritedepth ( 2, 300 )
rem load a stump image
LoadImage ( 207, "stump_001.png" )
createsprite ( 207, 207 )
setspritesize (207, 50, 50 )
setspritedepth ( 207, 200 )
setspriteshape ( 207, 1 )
do
rem move with cursor keys and joystick
mx#=GetVirtualJoystickX( 1 )
my#=GetVirtualJoystickY( 1 )
rem when there is no input stop animation
if ( mx# = 0.0 and my# = 0.0 )
stopsprite ( 1 )
setspriteframe ( 1, 8 )
else
rem find player position
x# = getspriteX ( 1 )
y# = getspriteY ( 1 )
rem work out movement direction
x1# = x# - mx#
y1# = y# - my#
rem face the correct angle
angle# = atanfull ( x1# - x#, y1# - y# )
setspriteangle ( 1, angle# )
setspriteposition ( 2, getspritex ( 2 ) - ( mx# / .40 ), getspritey ( 2 ) - ( my# / .40 ) )
rem play animation
if ( getspriteplaying ( 1 ) = 0 )
playsprite ( 1, 35, 1, 1, 24 )
endif
endif
`****************************************************
If GetSpriteCollision ( 1, 207 )
setspriteposition ( 1, x# - ( mx# / .40 ), y# - ( my# / .40 ) )
endif