mirror of
https://github.com/SEISYUNLie/Platform-Jump.git
synced 2026-10-24 01:41:10 +08:00
19 lines
416 B
GDScript
19 lines
416 B
GDScript
extends Area2D
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
body_entered.connect(take_damage)
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
pass
|
|
|
|
func take_damage(body):
|
|
if body.is_in_group("player"):
|
|
body.take_damage(1)
|
|
if body.health <= 0:
|
|
return
|
|
body.global_position = body.respownpoint
|