Limited Space
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
ld54/scripts/gameplay/rising_level.gd

24 lines
465 B

extends Area2D
class_name RisingLevel
@export var RISING_SPEED = 30
func _ready():
body_entered.connect(_body_entered)
body_exited.connect(_body_exited)
func _physics_process(delta):
$shape.position.y -= RISING_SPEED * delta
self.position = self.position
func _body_entered(body):
if body.is_in_group("player"):
body.swim()
if body.is_in_group("npc"):
body.die(RISING_SPEED)
func _body_exited(body):
if body.is_in_group("player"):
body.unswim()