Like in Toxic (Nitrome) They have lasers that when they hit the wall, they stop.
I want to make something like that in Scratch. But It has to be fast too.
Like a straight line that changes length depending on the wall.
I've seen this in Scratch one time. But I forgot what its called.
Offline
The best way to do this is the "forced" method. Basically, instead of letting Scratch repeat a cycle until it hits a wall, you force it to run the entire cycle in one go.
Say you have a sprite that is 20 pixels long and 1 or 2 wide.
Your script would look something like this:
when I receive (laser) If you're using a broadcast
go to (player)
set (touching?) to (False)
point in direction (direction of player)
if touching?=False:
move (20)
set (touching?) to <touching wall>
copy the above at least 16 times.
Offline