Skip to content

Commit 8d07dfc

Browse files
committed
Make player's turret shoot straight
1 parent 530b4f5 commit 8d07dfc

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

game/ship_skeleton/cell_modifications/base_player_turret.gd

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ extends Node2D
66

77
func _unhandled_input(event: InputEvent) -> void:
88
if event.is_action_pressed(&"shoot"):
9-
var direction := shooting_pos.global_position.direction_to(get_global_mouse_position())
9+
# NOTE. For player will shot straight for now. For AI perhaps could rotate turrets.
10+
#var direction := shooting_pos.global_position.direction_to(get_global_mouse_position())
11+
var direction := Vector2.RIGHT.rotated(global_rotation)
1012
# HACK. Owner will be ship skeleton. But we need owner of ship skeleton.
1113
Projectile.create(owner.owner, shooting_pos.global_position, direction, Projectiles.SIMPLE_BULLET)
1214

13-
if event is InputEventMouseMotion:
14-
look_at(get_global_mouse_position())
15+
# NOTE. Disable turrent rotation for now.
16+
#if event is InputEventMouseMotion:
17+
#look_at(get_global_mouse_position())

0 commit comments

Comments
 (0)