blob: 17e98ad46d74f1130603f4e69b7b1b29b463786d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
extends Area
const Loader = preload("res://scripts/LevelLoader.gd")
var loader: Loader = null
# Called when the node enters the scene tree for the first time.
func _ready():
loader = get_node("/root/Game/LevelLoader")
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_Area2_body_entered(body: RigidBody):
# return when body is not a rigidbody
if body == null:
return
loader.load_next_level()
|