Envie/Levels/level.gd

60 lines
1.0 KiB
GDScript3
Raw Normal View History

extends Node2D
@onready var doors = $Doors;
2023-01-15 15:02:42 -05:00
var mimic_count = 0;
func _ready():
pass
func _process(delta):
2023-01-15 15:02:42 -05:00
if mimic_count >= 4 :
doors.remove_child($Doors/Bathroom_Bottom);
doors.remove_child($Doors/Cafeteria);
func _on_pickable_t_shirt_picked():
doors.remove_child($Doors/FrontDoor_Left);
doors.remove_child($Doors/FrontDoor_Right);
func _on_outside_enemy_is_killed():
doors.remove_child($Doors/ClassDoor);
func _on_shoes_picked():
doors.remove_child($Doors/Bathroom_Top);
2023-01-15 15:02:42 -05:00
func _on_mimic_01_is_killed():
mimic_count += 1;
func _on_mimic_03_is_killed():
mimic_count += 1;
func _on_mimic_04_is_killed():
mimic_count += 1;
func _on_mimic_02_is_killed():
mimic_count += 1;
func _on_pants_picked():
doors.remove_child($Doors/Locker);
func _on_gym_enemy_05_is_killed():
doors.remove_child($Doors/Gym);
doors.remove_child($Doors/BackDoor_Left);
doors.remove_child($Doors/BackDoor_Right);
func _on_area_2d_body_entered(body):
if body.name == "Player":
win();
func win():
get_tree().change_scene_to_file("res://YouWin.tscn");