sweep
Member
Hope someone can help. I've set up a player who can throw a dagger . The code is below. But in the game the player throws multiple daggers. I only want to show one dagger . I've tried to figure it out but without much luck. I know using two dagger images (one facing left/ one right) isn't the correct way to keep the dagger traveling in the players direction and the right way around, but changing the image_xscale caused more problems.
( the button i am using is keyboard_check_pressed(vk_alt) )
function scr_playerstaterthrow()
{
sprite_index = spritethrow;
image_speed = 1;
global.daggeramount = -1
with(instance_create_layer(x,y-9,"player",obj_dagger))
{
speed = 10
if (obj_player.image_xscale = 1)
{
image_speed = 0
image_index = 0
direction = 0
}
else
{
direction = 180;
image_speed = 0
image_index = 1
}
}
}
( the button i am using is keyboard_check_pressed(vk_alt) )
function scr_playerstaterthrow()
{
sprite_index = spritethrow;
image_speed = 1;
global.daggeramount = -1
with(instance_create_layer(x,y-9,"player",obj_dagger))
{
speed = 10
if (obj_player.image_xscale = 1)
{
image_speed = 0
image_index = 0
direction = 0
}
else
{
direction = 180;
image_speed = 0
image_index = 1
}
}
}
Last edited: