D
Donnyyyyy
Guest
Hey. Trying to make a click to move type of game in Game Maker 2. (GML) I've managed to program the moving itself. But need help programming the character changing sprites based on the direction it is moving in.
The character has 4 directions. Left, right, Up and Down. Is here any way to make it use the Up walking animation if you click somewhere above it? Same with down, right and left.
This is the Step event I use for its point to click moving.
"
if (xx != mouse.none && yy != mouse.none) {
move_towards_point (xx,yy,spd);
} else {
speed = 0;
}
if (distance_to_point(xx,yy) < spd + 2) {
xx = mouse.none;
yy = mouse.none;
}
"
If anyone would like to help me with this id appreciate it ALOT!
The character has 4 directions. Left, right, Up and Down. Is here any way to make it use the Up walking animation if you click somewhere above it? Same with down, right and left.
This is the Step event I use for its point to click moving.
"
if (xx != mouse.none && yy != mouse.none) {
move_towards_point (xx,yy,spd);
} else {
speed = 0;
}
if (distance_to_point(xx,yy) < spd + 2) {
xx = mouse.none;
yy = mouse.none;
}
"
If anyone would like to help me with this id appreciate it ALOT!