Y
ynckw
Guest
Hello
I created a 2d space shooter in which the player can be controlled with a joystick (mobile game). the player looks in the direction in which the joystick is used (mouse point). now i need a button to shoot . I have created an object that creates the sprite (GUI) at a certain point so that it always stays in the same place even when the camera is moving. how do I get it that the player does not move in the direction of the mouse but only in the direction of the joystick so that I can press the button with my other finger to shoot without the player then immediately turning the shot button.
i made the shoot on windows with space bar:
if (keyboard_check_pressed(vk_space)) {
create_bullet(image_angle, bulletSpd, faction, guns)
}
but why does not work this?
if mouse_check_button_pressed(mb_left) {
if collision_point(mouse_x, mouse_y, obj_shoot, true, false) {
create_bullet(image_angle, bulletSpd, faction, guns)
}
}
thank you
I created a 2d space shooter in which the player can be controlled with a joystick (mobile game). the player looks in the direction in which the joystick is used (mouse point). now i need a button to shoot . I have created an object that creates the sprite (GUI) at a certain point so that it always stays in the same place even when the camera is moving. how do I get it that the player does not move in the direction of the mouse but only in the direction of the joystick so that I can press the button with my other finger to shoot without the player then immediately turning the shot button.
i made the shoot on windows with space bar:
if (keyboard_check_pressed(vk_space)) {
create_bullet(image_angle, bulletSpd, faction, guns)
}
but why does not work this?
if mouse_check_button_pressed(mb_left) {
if collision_point(mouse_x, mouse_y, obj_shoot, true, false) {
create_bullet(image_angle, bulletSpd, faction, guns)
}
}
thank you