P
Pikpik
Guest
So I have a shooting ability, but the projectiles only go to the right. I want the bullets to go the direction the player is facing when they are shot out.
Here's the code I have currently:
I got most of it from this video:
Here's the code I have currently:
GML:
//shoot
if keyboard_check(ord("X"))
{
sprite_index = spr_player_shoot;
image_index = 0
}
firingdelay = firingdelay - 1;
if keyboard_check(ord("X")) && (firingdelay < 0)
{
firingdelay = 10;
with (instance_create_layer(x+15,y+23,"Instances",obj_projectile))
{
speed = 10;
direction = other.image_xscale;
image_xscale = direction;
}
}