Im trying to do a game where a sprite is supposed to stop when it touches a black frame, it works when you just touch the arrows once,but when you leave it pressed it just keeps moving,and gets out of the frame,so it would be extremely easy to cheat.
This is what Im currently doing:
<when green flag clicked>
<forever if><touching color[ black
<turn cw( 90 )degrees>
<move( 5)steps>
Offline
So i suppose you have your movement script somewhere else?
I think it will be best to do this:
[blocks]
<when green flag clicked>
<forever>
<if> touching color black
<turn cw( 90 )degrees>
<move( 5 )steps>
<else>
movement: will stop when touching black
<end>
<end>
[/blocks]
Last edited by JSO (2008-05-04 02:28:37)
Offline
Have a look at the way the pacman is constrained in the demo that comes with scratch - it uses a colour sensor that prevents the pcaman from moving forwards if the sensor is touching the wall - meaning the main sprite stops without overlapping the wall.
Offline
thanks for the help!Ill be able to finnish my game
Offline