im making a game with a overhead/birdseye view and i cant figure out that when he touches the coulor(of the wall) he goes backwards so they dont walk on those parts if you want to see what i mean search zelda demo i downloaded it but couldnt figur it out. please help thanx
Offline
Say
when green flag clicked for ever if sensing (color) Turn sprite one 180 degrees move # steps.
Offline
There are 2 methods.
One is to after moving to see if you are touching the wall, and if so move backwards until you are not. This often works well but can look flickery when used in platform games versus gravity.
The second is to use a sensor (a tiny coloured dot) attached to your sprite that checks whether the move is valid before it takes place, and only allows the move if it is into a clear space.
FOREVER
--IF {{ up arrow pressed} AND {colour x touching colour y}}
----Move forward 10
A demo can be seen in the bacman game that comes with scratch. This is my prefered method.
Offline