Pages: 1
Topic closed
I need the enemys to track the player in a maze, and the player shoots them. they need to regen. also, they must "bounce" off the maze made in stage.
really need help, as this is my school project for game design!
Offline
Please Help!!!
Offline
There is not block for bouncing but the best way to script it is by:
You must Set the colour of your walls depending on what direction the wall is facing, in my example I will use:
Red - Facing up
Blue - Facing Down
Green - Facing Left
Yellow - Facing Right
Forever
IF <Touching Colour>["red"]
Change Y By [1]
IF <Touching Colour>["blue"]
Change Y By [-1]
IF <Touching Colour>["green"]
Change X By [-1]
IF <Touching Colour>[yellow"]
Change X By [1]
This Should make the sprite its on bounce of the right walls,
You MUST make the walls the right colour
They must all face in a perfect direction
Hoped that helped..
Offline
Like the above post said, make each wall a different color. However, with this formula you only need to make horizontal walls one color and vertical walls another:
when gf clicked set [speed v] to (5) forever set [speed x v] to ([sin v] of ((direction) * (speed))) set [speed y v] to ([cos v] of ((direction) * (speed))) change x by (speed x) if <touching color [#000000]?> set [speed x v] to ((speed x) * (-1)) end change y by (speed y) if <touching color [#ffffff]?> set [speed y v] to ((speed y) * (-1)) end point in direction ([atan v] of ((speed x) / (speed y))) if <(speed y) < (0)> turn cw (180) degrees endKeep in mind the colors can be any color but each other
Last edited by chanmanpartyman (2012-04-28 14:52:00)
Offline
Topic closed
Pages: 1