feat: arrows and stuff
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 6s
Create tag and build when new code gets to main / Export (push) Successful in 2m22s

This commit is contained in:
2025-08-02 15:51:29 +02:00
parent e3545a5087
commit 3450c463f9
17 changed files with 311 additions and 2 deletions

36
arrow/arrow.gd Normal file
View File

@ -0,0 +1,36 @@
extends RigidBody2D
@onready var area_2d: Area2D = $Area2D
@onready var kill_after: Timer = $KillAfter
@export var speed = 100
@export var rotation_speed = 1
@export var jump_strength_on_death = 100
var is_moving = true
var first_frame_available = true
func _ready() -> void:
freeze = true
func _physics_process(delta: float) -> void:
if is_moving:
position.x -= speed
else:
freeze = false
area_2d.monitoring = false
area_2d.monitorable = false
linear_velocity.x = 0
linear_velocity += get_gravity() * delta
angular_velocity = rotation_speed
if first_frame_available:
apply_impulse(Vector2.UP * jump_strength_on_death)
first_frame_available = false
func _on_kill_after_timeout() -> void:
queue_free()
func _on_body_entered(body: Node) -> void:
is_moving = false
kill_after.start()