hello im good with scratch but i wanna know how to move a player radomely but when touching a certain colour it turns cuz im making a game and theres a brown fence so i need it to bounce back when touching coour brown thanks
from princes1234
Offline
if you want the player to bounce back then you dont want them to move randomly but if you want them to move randomly try this:
if <touching colour []>
change x by (pick random (-3) to (3))
change y by (pick random (-3) to (3))
Offline
benjamin2 wrote:
It requires very advanced trigonometry to detect the trajectory of the wall.
Not really, assuming its only horizontal, vertical or 45 125 etc degrees. you just need a sensor
forever if <touching color (brown)?> if <color (left colour) is touching (brown)?> change x by (5)and you do that for the other colours
Last edited by zammer990 (2012-08-29 17:29:43)
Offline
You can supply your own modifier finished listener to the path modifier, when the method is called you can create and add a new path modifier to your sprite.
It's really inefficient though as you have to create a new Path object and a new Path Modifier object each time when all you're doing is changing some values.
If you find that you're using too much memory its worth rewriting, or at least adding to those classes to allow them to be updated rather than recreated.
Offline