how do i make an impassable wall like a maze?
thanks.
watashi
Offline
There are many ways, depending on how the sprite moves, what perspective the game is at and many more things, there is not really a single way to do it however the easiest way to do it is make it move back some steps when it is touching the colour of the wall, if you use changing the direction to move.
If not the easiest way is probably to check if it is touching the colour just as it moves, if it is it moves back depending on which way it just moved.
Offline
colorfusion wrote:
There are many ways, depending on how the sprite moves, what perspective the game is at and many more things, there is not really a single way to do it however the easiest way to do it is make it move back some steps when it is touching the colour of the wall, if you use changing the direction to move.
If not the easiest way is probably to check if it is touching the colour just as it moves, if it is it moves back depending on which way it just moved.
Like this:
When green flag clicked Forever if touching color black move -3 steps End Forever
Offline
For a maze, you MAY have to use this script, because sometimes you just make it change x and change y. If you use if right arrow clicked point in direction 0, move 10 steps, then you can use the script mentioned above.
When flag clicked
Forever
If touching colour impassablewallcolour
point in direction ( direction - 180 )
move 3 steps
EndIf
EndForever
Offline
Here is what I use, just replace the first colors with the colors of each side of the sprite (corresponding with up, left, right, and down) and replace the second color with the "impenetrable" wall. Then replace "2" with the speed you want your sprite to go.
that way works better than
colorfusion wrote:
There are many ways, depending on how the sprite moves, what perspective the game is at and many more things, there is not really a single way to do it however the easiest way to do it is make it move back some steps when it is touching the colour of the wall, if you use changing the direction to move.
If not the easiest way is probably to check if it is touching the colour just as it moves, if it is it moves back depending on which way it just moved.
because it doesn't make the sprite jitter and usually doesn't come out with any glitches and when it does, it just means you painted the sides of the sprite incorrectly.
I hope I helped!
Last edited by -GizzardGulp- (2010-11-17 06:53:13)
Offline