Ok so i've got the wall blocking all set up, theres just one problem
once you've touched the wall your stuck in it how do i combat this?
(the x and y use -numbers if you going to the right and use positive if you going to the left)
Example (going right x would say -500) ( going left it would say 500)
http://dl.dropbox.com/u/25078942/scratchmario.PNG
- by the way that 360 second post restriction happens just for having the new scratchers not allowed img tags alert
Offline
Nevermind i have fixed this
i used a If not touching color
Offline
Ratchetclan4 wrote:
Nevermind i have fixed this
i used a If not touching color
Ignore what i said above
The problem is still there, what can i do to correct it?
Offline
Your problem is that you have told the sprite not to move at all if it's touching the color at... you can see where this is going.
To fix this, you should make a sensor sprite that is invisible (set the ghost effect to 100). The sprite will have four different colored sides, to determine which side is hitting something. For example, this is the code for the right 'bumper', assuming it's blue:
(Note this is general code, since I'm not entirely sure how yours works based on that screenshot. You'll have to modify it a bit to make it work with your project.)
When green flag clicked
forever
if color [blue] is touching color [red]
set right_test to 1
else
set right_test to 0
end_if
[code for other 3 bumpers]
end_forever"right_test_ is a variable that tells the player sprite if is touching a wall to the right. If it is equal to one, it can't move right.
Offline
Or if it is from a bird's eye point of view, either look at this
or
<when green flag clicked>
<forever>
<if><key[ Up Arrow ]pressed?>
<change y by( 3 )>
<if><touching color[ ColorOfWall ]>
<change y by( -3 )>
<end>
<end>
<end>
repeat for all directions (you can put them all in the same script, just use another if statement.
Last edited by MoreGamesNow (2011-04-24 21:27:21)
Offline