K
Kurumiseenpai
Guest
hi, how i can make that my character shoot in the direction he is looking?
this is my code
//write in player create
firingdelay = 0;
//this is write on player step
firingdelay = firingdelay -1;
if ((keyboard_check(ord("S")))) && (firingdelay < 0)
{
firingdelay = 5;
with (instance_create_layer(x,y,"Instances",oArmauno))
{
speed = 25;
direction = other.image_angle;
image_angle = direction;
}
}
//and in the bullet event i create just a post-draw with this
if (place_meeting(x,y,oplayerdue)) instance_destroy ();
if (place_meeting(x,y,oWall)) instance_destroy ();
this is my code
//write in player create
firingdelay = 0;
//this is write on player step
firingdelay = firingdelay -1;
if ((keyboard_check(ord("S")))) && (firingdelay < 0)
{
firingdelay = 5;
with (instance_create_layer(x,y,"Instances",oArmauno))
{
speed = 25;
direction = other.image_angle;
image_angle = direction;
}
}
//and in the bullet event i create just a post-draw with this
if (place_meeting(x,y,oplayerdue)) instance_destroy ();
if (place_meeting(x,y,oWall)) instance_destroy ();