so_many_mars/objects/oGun/Step_0.gml
Tyrel Souza 8854b848bc init
2022-02-21 18:45:19 -05:00

19 lines
513 B
Plaintext

/// @description Insert description here
// You can write your code in this editor
x = oPlayer.x;
y = oPlayer.y;
if gamepad_is_connected(0) {
var haxis = gamepad_axis_value(0, gp_axisrh);
var vaxis = gamepad_axis_value(0, gp_axisrv);
image_angle = point_direction(oPlayer.x, oPlayer.y, haxis, vaxis);
} else {
image_angle = point_direction(oPlayer.x, oPlayer.y, mouse_x, mouse_y);
}
if(image_angle > 90 && image_angle < 270) {
layer = layer_get_id("gunBack");
} else {
layer = layer_get_id("gunFront");
}