Pages: 1
the command "if on edge, bounce" anyway or ideas how to create a similar action for if a sprite is touching a certain colour or other sprite(preferably) without going through every x/y possibility and making sure that it moves that amount of x and that amount of y away from it ? i started trying with "move -x amount of steps" but that only really works if you're sprite is a perfect circle... in my situation the hands get in the way and he gets carried up the map by a flow of darkenss from the edge...
Offline
There is a way, but it's really fiddly and hard to get right. I don't know it.
Offline
as long as it works on any shape change(map change) and dont have to do a big list of sprites, cause i've done that before but i took a screenshot of every side and then depending on if it was the side or the bottom it was pushing up or away to the opposite side, but every single border side had to have a whole script to it self and when i was designing a veeery large map that took me a few months.
Offline
Try this?
when gf clicked go to x: (0) y: (0) point in direction (pick random (-179) to (180)) set [Move Speed v] to [0] forever move (Move Speed) steps if <touching [edge v]?> change x by (([sin v] of (direction)) * ((0) - (Move Speed))) if <touching [edge v]?> point in direction ((180) - (direction)) else point in direction ((0) - (direction)) end change x by (([sin v] of (direction)) * (Move Speed)) endTaken from the scratch wiki.
Offline
Are you saying that your sprite changes costumes and, as a result, ends up occupying space it normally wouldn't? I'd say your best bet is either to always switch back to a single costume during sensing or to use an invisible square sprite for all things movement-related (as a "collider") and have your costume-changing sprite always go to its location.
Offline
Prestige wrote:
Try this?
when gf clicked go to x: (0) y: (0) point in direction (pick random (-179) to (180)) set [Move Speed v] to [0] forever move (Move Speed) steps if <touching [edge v]?> change x by (([sin v] of (direction)) * ((0) - (Move Speed))) if <touching [edge v]?> point in direction ((180) - (direction)) else point in direction ((0) - (direction)) end change x by (([sin v] of (direction)) * (Move Speed)) endTaken from the scratch wiki.
played around with that and i managed to get it to a workable stage only 1 minor bug but this will make scripting soo much easier now back to photoshop to do the maps thnx alot for the help
Offline
Pages: 1