You could set up the unwalkable areas as a separate sprite, and then have the character return to it's last non-touching spot whenever it touches the unwalkable sprite. Something similar to this
http://scratch.mit.edu/projects/Paddle2SeeFixIt/188825
Offline
Or, alternatively:
when gf clicked forever if<key [up arrow v] pressed?> change y by (2) if<touching [unwalkable area v]?> change y by (-2) end end if<key [down arrow v] pressed?> change y by (-2) if<touching [unwalkable area v]?> change y by (2) end end if<key [right arrow v] pressed?> change x by (2) if<touching [unwalkable area v]?> change x by (-2) end end if<key [left arrow v] pressed?> change x by (-2) if<touching [unwalkable area v]?> change x by (2) end end
Offline
Paddle2See wrote:
You could set up the unwalkable areas as a separate sprite, and then have the character return to it's last non-touching spot whenever it touches the unwalkable sprite. Something similar to this
http://scratch.mit.edu/projects/Paddle2SeeFixIt/188825
Thank you so much!
Offline
MoreGamesNow wrote:
Or, alternatively:
when gf clicked forever if<key [up arrow v] pressed?> change y by (2) if<touching [unwalkable area v]?> change y by (-2) end end if<key [down arrow v] pressed?> change y by (-2) if<touching [unwalkable area v]?> change y by (2) end end if<key [right arrow v] pressed?> change x by (2) if<touching [unwalkable area v]?> change x by (-2) end end if<key [left arrow v] pressed?> change x by (-2) if<touching [unwalkable area v]?> change x by (2) end end
Thank you! I'll try it
Offline
Paddle2See wrote:
You could set up the unwalkable areas as a separate sprite, and then have the character return to it's last non-touching spot whenever it touches the unwalkable sprite. Something similar to this
http://scratch.mit.edu/projects/Paddle2SeeFixIt/188825
You just helped me in\mprove my game so much; thank youuu
Offline
WoopAhhh wrote:
MoreGamesNow wrote:
Or, alternatively:
when gf clicked forever if<key [up arrow v] pressed?> change y by (2) if<touching [unwalkable area v]?> change y by (-2) end end if<key [down arrow v] pressed?> change y by (-2) if<touching [unwalkable area v]?> change y by (2) end end if<key [right arrow v] pressed?> change x by (2) if<touching [unwalkable area v]?> change x by (-2) end end if<key [left arrow v] pressed?> change x by (-2) if<touching [unwalkable area v]?> change x by (2) end endThank you! I'll try it
Worked awesomeley!
Offline
mabye make the area a certian coulor, then do
when gf clicked forever if touching coulor blue turn 180 degrees move 1 steps? help!
Last edited by dogsandmariolover (2012-07-23 15:02:33)
Offline
dogsandmariolover wrote:
mabye make the area a certian coulor, then do
when gf clicked forever if <touching color [#0D00FF]?> turn cw (180) degrees move (1) steps? help!
That's a very bad way to do it, as it flips the sprite and involved direction (Am I the only one who dislikes it?)
Offline
zammer990 wrote:
dogsandmariolover wrote:
mabye make the area a certian coulor, then do
when gf clicked forever if <touching color [#0D00FF]?> turn cw (180) degrees move (1) steps? help!That's a very bad way to do it, as it flips the sprite and involved direction (Am I the only one who dislikes it?)
I dislike it because it prevents all movement rather than solely movement along a single axis. If I move right 1 and down 1, and there is a wall beneath me, I still expect to be moved right by 1. There are ways to accommodate this, but all of them are more complex (or less easily understood) than traditional 2-dimensional movement.
Offline