kureoni
Member
GML:
var move_left = keyboard_check(ord( "A"));
var move_right = keyboard_check(ord("D"));
var move_down = keyboard_check(ord("S"));
var move_up = keyboard_check(ord("W"));
if (move_left && place_free(x-spd,y)){
x-=spd;
}
if (move_right && place_free(x+spd,y)){
x+=spd;
}
if (move_down && place_free(x, y+spd)){
y+=spd;
}
if (move_up && place_free(x, y-spd)){
y-=spd;
}
if(y > mouse_y){
sprite_index = spr_player_back
}
if(y < mouse_y){
sprite_index = spr_player_front
}
if(y != yprevious && y > mouse_y){
sprite_index = spr_player_walkback
}
if(y != yprevious && y < mouse_y){
sprite_index = spr_player_walkfront
}
if(y < mouse_y && x != xprevious){
sprite_index = spr_player_walkfront
}
if(y > mouse_y && x != xprevious){
sprite_index = spr_player_walkback
}
if(x < mouse_x && x = xprevious){
image_xscale = 3
sprite_index = spr_player
}
if(x > mouse_x && x = xprevious){
image_xscale = -3
sprite_index = spr_player
}
if(x < mouse_x && x != xprevious){
image_xscale = 3
sprite_index = spr_player_walk
}
if(x > mouse_x && x != xprevious){
image_xscale = -3
sprite_index = spr_player_walk
(it works on x but i does not on y, or it works on y but not on x)