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:
whenclicked
foreverifkeyup arrow ▼pressed?change y by2iftouchingunwalkable area ▼?change y by-2ifkeydown arrow ▼pressed?change y by-2iftouchingunwalkable area ▼?change y by2ifkeyright arrow ▼pressed?change x by2iftouchingunwalkable area ▼?change x by-2ifkeyleft arrow ▼pressed?change x by-2iftouchingunwalkable area ▼?change x by2
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:
whenclicked
foreverifkeyup arrow ▼pressed?change y by2iftouchingunwalkable area ▼?change y by-2ifkeydown arrow ▼pressed?change y by-2iftouchingunwalkable area ▼?change y by2ifkeyright arrow ▼pressed?change x by2iftouchingunwalkable area ▼?change x by-2ifkeyleft arrow ▼pressed?change x by-2iftouchingunwalkable area ▼?change x by2
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:
whenclicked
foreverifkeyup arrow ▼pressed?change y by2iftouchingunwalkable area ▼?change y by-2ifkeydown arrow ▼pressed?change y by-2iftouchingunwalkable area ▼?change y by2ifkeyright arrow ▼pressed?change x by2iftouchingunwalkable area ▼?change x by-2ifkeyleft arrow ▼pressed?change x by-2iftouchingunwalkable area ▼?change x by2Thank you! I'll try it
Worked awesomeley!
Offline
mabye make the area a certian coulor, then do
? help!when gf clicked forever if touching coulor blue turn 180 degrees move 1 steps
Last edited by dogsandmariolover (2012-07-23 15:02:33)
Offline
dogsandmariolover wrote:
mabye make the area a certian coulor, then do
? help!whenclicked
forever iftouching color ?turn
180degreesmove1steps
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
? help!whenclicked
forever iftouching color ?turn
180degreesmove1stepsThat'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