Hi, i have an rpg game in which the character forever points at the mouse, you have WASD controls. I want the character to avoid walking when touching the color gray, therefore I made the character back off 1 step when walking towards the wall, but, if the character walk backwards in to the wall, then he can go right through. Any ideas on how to do this? Thank you.
Offline
Both of the games below will help you with your project. The first one works by having walls with 4 different colours, one for each side. The character will sense whether it is touching a specific wall, and move depending on the direction. The second one works by having 4 variables; x,y, X_old, and Y_old. As the character moves it is constantly putting x and y to their respective x's and y's. If the char. isn't touching a wall, the old_Y and old_X will be set to x and y respectively. When the char. touches a wall, it will set the x and y to the old_X and old_Y. Check out the scripts for more detail.
Maze
Maze 2
Offline
BomberE wrote:
Both of the games below will help you with your project. The first one works by having walls with 4 different colours, one for each side. The character will sense whether it is touching a specific wall, and move depending on the direction. The second one works by having 4 variables; x,y, X_old, and Y_old. As the character moves it is constantly putting x and y to their respective x's and y's. If the char. isn't touching a wall, the old_Y and old_X will be set to x and y respectively. When the char. touches a wall, it will set the x and y to the old_X and old_Y. Check out the scripts for more detail.
Maze
Maze 2
Wow I've never thought about that, THANK YOU!!!
Offline
BomberE wrote:
Both of the games below will help you with your project. The first one works by having walls with 4 different colours, one for each side. The character will sense whether it is touching a specific wall, and move depending on the direction. The second one works by having 4 variables; x,y, X_old, and Y_old. As the character moves it is constantly putting x and y to their respective x's and y's. If the char. isn't touching a wall, the old_Y and old_X will be set to x and y respectively. When the char. touches a wall, it will set the x and y to the old_X and old_Y. Check out the scripts for more detail.
Maze
Maze 2
I made this basic game with your awesome idea
http://scratch.mit.edu/projects/ArloarLoLs/2934080
Offline