made the game real

This commit is contained in:
pennyrigate 2025-12-09 17:19:05 -05:00
parent dccc27dd72
commit e2ddd9cefe
15 changed files with 211 additions and 10 deletions

View file

@ -0,0 +1,22 @@
extends Node2D
@export var Bullet: PackedScene
func _input(event: InputEvent) -> void:
if event.is_action_pressed("shoot"):
$Timer.start()
_on_timer_timeout()
elif event.is_action_released("shoot"):
$Timer.stop()
func _on_timer_timeout() -> void:
print("yeth")
var bullet = Bullet.instantiate()
get_owner().get_owner().add_child(bullet)
bullet.global_position = $Marker2D.global_position
var bullet2 = Bullet.instantiate()
get_owner().get_owner().add_child(bullet2)
bullet2.global_position = $Marker2D2.global_position