so_many_mars/objects/oGun/Step_0.gml

19 lines
513 B
Plaintext
Raw Permalink Normal View History

2022-02-21 23:45:19 +00:00
/// @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");
}