#Shooting system to my platform game

1 messages · Page 1 of 1 (latest)

midnight rapids
#

I've created a shooting system for my game, but for some reason, if I look to the left, the height from which the shot comes is wrong

the method I used for it to turn left or right:
if (hspd != 0) image_xscale = sign(hspd)

Shooting system:

var flipped = direction
var gun_x = (x+4)*(flipped)
var _xx = x + lengthdir_x(1,image_angle)
var y_offset = lengthdir_y(40,image_angle)

if key_attack && global.balas > 0
{
with (instance_create_layer(_xx,y-40,"ataque",obj_bala))
{
global.balas--
speed = 4
direction = -90 + 90 * other.image_xscale
image_angle = direction
}
}

if key_reload && global.balas = 0
{
global.balas = 10
}

tacit moth
#

1 or 2

tacit moth