Soso
Member
I'm drawing equipment over the player sprite.
ex: helm, body, legs
the problem I'm having is on
keyboard_check(ord("W")))
{ vspeed = -(spd); }
it draws the spr_player_moving_up
even with no draw_self() in the draw event
causing the player sprite to be drawn on top of the helm. However tho the body draws correctly over the sprite for some reason just not the helm.
why is it drawing a sprite when there is no draw_self() in the draw event
All the other draw_sprites are the same setup
ex: helm, body, legs
the problem I'm having is on
keyboard_check(ord("W")))
{ vspeed = -(spd); }
it draws the spr_player_moving_up
even with no draw_self() in the draw event
causing the player sprite to be drawn on top of the helm. However tho the body draws correctly over the sprite for some reason just not the helm.
why is it drawing a sprite when there is no draw_self() in the draw event
Code:
///controls
if (keyboard_check(ord("W")))
{ vspeed = -(spd); } /// the problem comes from this check
if (keyboard_check(ord("A")))
{ hspeed = -(spd); }
if (keyboard_check(ord("S")))
{ vspeed = +(spd); }
if (keyboard_check(ord("D")))
{ hspeed = +(spd); }
//release
if (keyboard_check_released(ord("W")))
{ vspeed = 0;
hspeed = 0; }
if (keyboard_check_released(ord("S")))
{ vspeed = 0;
hspeed = 0; }
if (keyboard_check_released(ord("A")))
{ vspeed = 0;
hspeed = 0; }
if (keyboard_check_released(ord("D")))
{ vspeed = 0;
hspeed = 0; }
//sets moving sprites ==========================================================================
if (vspeed > 0)
{ sprite_index = spr_player_move_down;
image_speed = 0.2;
face_direction = "move_down";}
if (vspeed < 0)
{ sprite_index = spr_player_move_up;
image_speed = 0.2;
face_direction = "move_up"; }
if (hspeed > 0)
{ sprite_index = spr_player_move_right;
image_speed = 0.2;
face_direction = "move_right"; }
if (hspeed < 0)
{ sprite_index = spr_player_move_left;
image_speed = 0.2;
face_direction = "move_left"; }
//sets idle sprites
if (hspeed == 0 && vspeed == 0) { //nest
if (sprite_index == spr_player_move_down)
{sprite_index = spr_player_idle_down;
image_speed = 0.1;
face_direction = "idle_down"; }
if (sprite_index == spr_player_move_up)
{sprite_index = spr_player_idle_up;
image_speed = 0.1;
face_direction = "idle_up"; }
if (sprite_index == spr_player_move_right)
{sprite_index = spr_player_idle_right;
image_speed = 0.1;
face_direction = "idle_right"; }
if (sprite_index == spr_player_move_left)
{sprite_index = spr_player_idle_left;
image_speed = 0.1;
face_direction = "idle_left"; }
} //end nest
Code:
///draw equipment on player
//draw_self();
//helms
if (helm == "iron_helm"){ //wrap
if (face_direction == "idle_up")
{draw_sprite(spr_iron_helm_idle_up,image_index,x,y);}
if (face_direction == "idle_down")
{draw_sprite(spr_iron_helm_idle_down,image_index,x,y);}
if (face_direction == "idle_right")
{draw_sprite(spr_iron_helm_idle_right,image_index,x,y);}
if (face_direction == "idle_left")
{draw_sprite(spr_iron_helm_idle_left,image_index,x,y);}
if (face_direction == "move_up")
{draw_sprite(spr_iron_helm_move_up,image_index,x,y);}
if (face_direction == "move_down")
{draw_sprite(spr_iron_helm_move_down,image_index,x,y);}
if (face_direction == "move_right")
{draw_sprite(spr_iron_helm_move_right,image_index,x,y);}
if (face_direction == "move_left")
{draw_sprite(spr_iron_helm_move_left,image_index,x,y);}
} //end wrap
All the other draw_sprites are the same setup
Last edited: