hp bar and borders

This commit is contained in:
Tabby 2025-07-20 17:33:13 +10:00
parent 4fa6a88b54
commit 16d7559965
10 changed files with 252 additions and 2 deletions

18
screen_borders.gd Normal file
View file

@ -0,0 +1,18 @@
extends Area2D
@export var collider : CollisionShape2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_body_entered(body: Node2D) -> void:
if body is RigidBody2D:
#body.apply_force((body.global_position - global_position).normalized() *10000)
body.linear_velocity = (collider.shape.normal).normalized() *100
body.got_hit.emit()