Compare commits
3 Commits
1056e5419e
...
65369ec029
| Author | SHA1 | Date |
|---|---|---|
|
|
65369ec029 | 2 years ago |
|
|
1adc44150b | 2 years ago |
|
|
5024b58f39 | 2 years ago |
@ -0,0 +1,27 @@ |
||||
extends Area2D |
||||
|
||||
@export var KILL_ALL_NPCS = false |
||||
@export var LEVEL_MESSAGE : String = '' |
||||
@export var ENABLED_NODES : Array[Node] = [] |
||||
@export var DISABLED_NODES : Array[Node] = [] |
||||
|
||||
# Called when the node enters the scene tree for the first time. |
||||
func _ready(): |
||||
body_entered.connect(on_body_entered) |
||||
|
||||
|
||||
func on_body_entered(body): |
||||
if !body.is_in_group('player'): |
||||
return |
||||
|
||||
if KILL_ALL_NPCS: |
||||
if body.is_in_group("npc"): |
||||
body.queue_free() |
||||
if LEVEL_MESSAGE: |
||||
# TODO |
||||
print(LEVEL_MESSAGE) |
||||
pass |
||||
for node in ENABLED_NODES: |
||||
node.set_physics_process(true) |
||||
for node in DISABLED_NODES: |
||||
node.set_physics_process(false) |
||||
@ -0,0 +1,7 @@ |
||||
[gd_scene load_steps=2 format=3 uid="uid://cdq58egi0j65h"] |
||||
|
||||
[ext_resource type="Script" path="res://nodes/triggers/level_trigger.gd" id="1_amwjw"] |
||||
|
||||
[node name="level_trigger" type="Area2D"] |
||||
monitorable = false |
||||
script = ExtResource("1_amwjw") |
||||
@ -0,0 +1,11 @@ |
||||
extends Area2D |
||||
|
||||
@export_file('*.tscn') var WIN_SCENE; |
||||
|
||||
# Called when the node enters the scene tree for the first time. |
||||
func _ready(): |
||||
body_entered.connect(on_body_entered) |
||||
|
||||
func on_body_entered(body): |
||||
if body.is_in_group('player'): |
||||
get_tree().change_scene_to_file(WIN_SCENE) |
||||
@ -0,0 +1,8 @@ |
||||
[gd_scene load_steps=2 format=3 uid="uid://de7ehbowni47v"] |
||||
|
||||
[ext_resource type="Script" path="res://nodes/triggers/win_trigger.gd" id="1_jk7wd"] |
||||
|
||||
[node name="win_trigger" type="Area2D"] |
||||
monitorable = false |
||||
script = ExtResource("1_jk7wd") |
||||
WIN_SCENE = "res://scenes/win_screen.tscn" |
||||
@ -0,0 +1,43 @@ |
||||
[gd_scene load_steps=3 format=3 uid="uid://ckt2twwgcgwtt"] |
||||
|
||||
[ext_resource type="Script" path="res://scripts/ui/change_scene_button.gd" id="1_oyu1u"] |
||||
[ext_resource type="Script" path="res://scripts/ui/quit_button.gd" id="2_7spq8"] |
||||
|
||||
[node name="lose_screen" type="Control"] |
||||
layout_mode = 3 |
||||
anchors_preset = 15 |
||||
anchor_right = 1.0 |
||||
anchor_bottom = 1.0 |
||||
grow_horizontal = 2 |
||||
grow_vertical = 2 |
||||
|
||||
[node name="Panel" type="Panel" parent="."] |
||||
layout_mode = 0 |
||||
offset_right = 1920.0 |
||||
offset_bottom = 1080.0 |
||||
|
||||
[node name="Label" type="Label" parent="Panel"] |
||||
layout_mode = 0 |
||||
offset_right = 1912.0 |
||||
offset_bottom = 376.0 |
||||
text = "You lose" |
||||
horizontal_alignment = 1 |
||||
vertical_alignment = 1 |
||||
|
||||
[node name="Button" type="Button" parent="Panel"] |
||||
layout_mode = 0 |
||||
offset_left = 800.0 |
||||
offset_top = 744.0 |
||||
offset_right = 1144.0 |
||||
offset_bottom = 840.0 |
||||
text = "Play Again" |
||||
script = ExtResource("1_oyu1u") |
||||
TARGET_SCENE = "res://scenes/main_menu.tscn" |
||||
|
||||
[node name="quit" type="Button" parent="Panel"] |
||||
offset_left = 629.0 |
||||
offset_top = 875.0 |
||||
offset_right = 1284.0 |
||||
offset_bottom = 952.0 |
||||
text = "Quit" |
||||
script = ExtResource("2_7spq8") |
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,43 @@ |
||||
[gd_scene load_steps=3 format=3 uid="uid://tb03t1t5hcxs"] |
||||
|
||||
[ext_resource type="Script" path="res://scripts/ui/change_scene_button.gd" id="1_ajo3i"] |
||||
[ext_resource type="Script" path="res://scripts/ui/quit_button.gd" id="2_6iycq"] |
||||
|
||||
[node name="win_screen" type="Control"] |
||||
layout_mode = 3 |
||||
anchors_preset = 15 |
||||
anchor_right = 1.0 |
||||
anchor_bottom = 1.0 |
||||
grow_horizontal = 2 |
||||
grow_vertical = 2 |
||||
|
||||
[node name="Panel" type="Panel" parent="."] |
||||
layout_mode = 0 |
||||
offset_right = 1920.0 |
||||
offset_bottom = 1080.0 |
||||
|
||||
[node name="Label" type="Label" parent="Panel"] |
||||
layout_mode = 0 |
||||
offset_right = 1912.0 |
||||
offset_bottom = 376.0 |
||||
text = "You won" |
||||
horizontal_alignment = 1 |
||||
vertical_alignment = 1 |
||||
|
||||
[node name="Button" type="Button" parent="Panel"] |
||||
layout_mode = 0 |
||||
offset_left = 800.0 |
||||
offset_top = 744.0 |
||||
offset_right = 1144.0 |
||||
offset_bottom = 840.0 |
||||
text = "Play Again" |
||||
script = ExtResource("1_ajo3i") |
||||
TARGET_SCENE = "res://scenes/main_menu.tscn" |
||||
|
||||
[node name="quit" type="Button" parent="Panel"] |
||||
offset_left = 629.0 |
||||
offset_top = 875.0 |
||||
offset_right = 1284.0 |
||||
offset_bottom = 952.0 |
||||
text = "Quit" |
||||
script = ExtResource("2_6iycq") |
||||
Loading…
Reference in new issue