A
Annthoni
Guest
Im new to game maker 2, and well creating games in general, ive been following some tutorials and decided to be abit creative early on by designing a off center barrel gun for my sprite, when the bullets fire to the right they seem to match the barrel, but they dont when the sprite flips to the left, can anyone help with this?
///Create bullet
var dir = point_direction(x, y, mouse_x, mouse_y);
var xscale = (mouse_x > x)*2-1;
var gun_x = x-4*xscale;
var x_offset = lengthdir_x(30, dir);
var y_offset = lengthdir_y(30, dir);
instance_create_layer(gun_x+x_offset, y+y_offset, "Instances", o_bullet);
this is the code ive been using
///Create bullet
var dir = point_direction(x, y, mouse_x, mouse_y);
var xscale = (mouse_x > x)*2-1;
var gun_x = x-4*xscale;
var x_offset = lengthdir_x(30, dir);
var y_offset = lengthdir_y(30, dir);
instance_create_layer(gun_x+x_offset, y+y_offset, "Instances", o_bullet);
this is the code ive been using