spawns all entities
connected chests to color/ui
This commit is contained in:
34
assets/boots.png.import
Normal file
34
assets/boots.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cn5lvdmjt2xue"
|
||||||
|
path="res://.godot/imported/boots.png-84b46c52c44b068496caeb3f7ead2e77.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/boots.png"
|
||||||
|
dest_files=["res://.godot/imported/boots.png-84b46c52c44b068496caeb3f7ead2e77.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
34
assets/chest.png.import
Normal file
34
assets/chest.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://b0h7llq1qb706"
|
||||||
|
path="res://.godot/imported/chest.png-ec5c0ce22911c81d595ed790e257ceb9.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/chest.png"
|
||||||
|
dest_files=["res://.godot/imported/chest.png-ec5c0ce22911c81d595ed790e257ceb9.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
34
assets/chest_opened.png.import
Normal file
34
assets/chest_opened.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cgkq30nhsygpe"
|
||||||
|
path="res://.godot/imported/chest_opened.png-79ff976633dae8a5bb7215b9c4c5529f.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/chest_opened.png"
|
||||||
|
dest_files=["res://.godot/imported/chest_opened.png-79ff976633dae8a5bb7215b9c4c5529f.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
34
assets/dot.png.import
Normal file
34
assets/dot.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://d32ory5gus4lm"
|
||||||
|
path="res://.godot/imported/dot.png-8f4927301bfe25b36ae6b38c2d837062.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/dot.png"
|
||||||
|
dest_files=["res://.godot/imported/dot.png-8f4927301bfe25b36ae6b38c2d837062.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
34
assets/eye.png.import
Normal file
34
assets/eye.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://c3ck7s86qc37a"
|
||||||
|
path="res://.godot/imported/eye.png-a84d27eb76574b804de06889c29718a8.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/eye.png"
|
||||||
|
dest_files=["res://.godot/imported/eye.png-a84d27eb76574b804de06889c29718a8.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
34
assets/heart.png.import
Normal file
34
assets/heart.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://doxv0y43t4770"
|
||||||
|
path="res://.godot/imported/heart.png-9a2fa56e49d8a002fed7c28ce07513e0.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/heart.png"
|
||||||
|
dest_files=["res://.godot/imported/heart.png-9a2fa56e49d8a002fed7c28ce07513e0.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
9
data/buffs/blue_buff.tres
Normal file
9
data/buffs/blue_buff.tres
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[gd_resource type="Resource" script_class="Buff" load_steps=3 format=3 uid="uid://djb1iyhb8gwqb"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cn5lvdmjt2xue" path="res://assets/boots.png" id="1_8dq50"]
|
||||||
|
[ext_resource type="Script" path="res://scripts/buff.gd" id="1_qg760"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_qg760")
|
||||||
|
image = ExtResource("1_8dq50")
|
||||||
|
color = 2
|
||||||
9
data/buffs/green_buff.tres
Normal file
9
data/buffs/green_buff.tres
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[gd_resource type="Resource" script_class="Buff" load_steps=3 format=3 uid="uid://bo7k3kmsq57xy"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/buff.gd" id="1_iyogh"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://c3ck7s86qc37a" path="res://assets/eye.png" id="1_jskem"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_iyogh")
|
||||||
|
image = ExtResource("1_jskem")
|
||||||
|
color = 1
|
||||||
9
data/buffs/red_buff.tres
Normal file
9
data/buffs/red_buff.tres
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[gd_resource type="Resource" script_class="Buff" load_steps=3 format=3 uid="uid://tiv2o1xk5g7e"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://doxv0y43t4770" path="res://assets/heart.png" id="1_gshhk"]
|
||||||
|
[ext_resource type="Script" path="res://scripts/buff.gd" id="2_8wfcu"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("2_8wfcu")
|
||||||
|
image = ExtResource("1_gshhk")
|
||||||
|
color = 0
|
||||||
15
data/themes/blue_progress_bar_theme.tres
Normal file
15
data/themes/blue_progress_bar_theme.tres
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[gd_resource type="Theme" load_steps=3 format=3 uid="uid://dm1sx57hw07cn"]
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_brxtc"]
|
||||||
|
bg_color = Color(0, 0, 0, 1)
|
||||||
|
corner_radius_top_left = 2
|
||||||
|
corner_radius_top_right = 2
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qebp0"]
|
||||||
|
bg_color = Color(0, 0, 1, 1)
|
||||||
|
corner_radius_top_left = 1
|
||||||
|
corner_radius_top_right = 1
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
ProgressBar/styles/background = SubResource("StyleBoxFlat_brxtc")
|
||||||
|
ProgressBar/styles/fill = SubResource("StyleBoxFlat_qebp0")
|
||||||
15
data/themes/green_progress_bar_theme.tres
Normal file
15
data/themes/green_progress_bar_theme.tres
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[gd_resource type="Theme" load_steps=3 format=3 uid="uid://ewgo3qi2xs54"]
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_brxtc"]
|
||||||
|
bg_color = Color(0, 0, 0, 1)
|
||||||
|
corner_radius_top_left = 2
|
||||||
|
corner_radius_top_right = 2
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qebp0"]
|
||||||
|
bg_color = Color(0, 1, 0, 1)
|
||||||
|
corner_radius_top_left = 1
|
||||||
|
corner_radius_top_right = 1
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
ProgressBar/styles/background = SubResource("StyleBoxFlat_brxtc")
|
||||||
|
ProgressBar/styles/fill = SubResource("StyleBoxFlat_qebp0")
|
||||||
15
data/themes/red_progress_bar_theme.tres
Normal file
15
data/themes/red_progress_bar_theme.tres
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[gd_resource type="Theme" load_steps=3 format=3 uid="uid://7w47qwaweedo"]
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_brxtc"]
|
||||||
|
bg_color = Color(0, 0, 0, 1)
|
||||||
|
corner_radius_top_left = 2
|
||||||
|
corner_radius_top_right = 2
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qebp0"]
|
||||||
|
bg_color = Color(1, 0, 0, 1)
|
||||||
|
corner_radius_top_left = 1
|
||||||
|
corner_radius_top_right = 1
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
ProgressBar/styles/background = SubResource("StyleBoxFlat_brxtc")
|
||||||
|
ProgressBar/styles/fill = SubResource("StyleBoxFlat_qebp0")
|
||||||
@@ -11,6 +11,7 @@ config_version=5
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="rgb"
|
config/name="rgb"
|
||||||
|
run/main_scene="res://scene/maze_1.tscn"
|
||||||
config/features=PackedStringArray("4.2", "GL Compatibility")
|
config/features=PackedStringArray("4.2", "GL Compatibility")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
|||||||
16
scene/enemy.tscn
Normal file
16
scene/enemy.tscn
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://beopqphfymjik"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/enemy.gd" id="1_a6qhu"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://d32ory5gus4lm" path="res://assets/dot.png" id="2_jkluv"]
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_c7wcn"]
|
||||||
|
radius = 6.0
|
||||||
|
|
||||||
|
[node name="Enemy" type="CharacterBody2D"]
|
||||||
|
script = ExtResource("1_a6qhu")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
texture = ExtResource("2_jkluv")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource("CircleShape2D_c7wcn")
|
||||||
91
scene/hud.tscn
Normal file
91
scene/hud.tscn
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
[gd_scene load_steps=7 format=3 uid="uid://dcpeowc6xcfcv"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://d32ory5gus4lm" path="res://assets/dot.png" id="1_tsiui"]
|
||||||
|
[ext_resource type="Script" path="res://scripts/hud.gd" id="1_yk6cu"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://doxv0y43t4770" path="res://assets/heart.png" id="2_4hybp"]
|
||||||
|
[ext_resource type="Theme" uid="uid://7w47qwaweedo" path="res://data/themes/red_progress_bar_theme.tres" id="2_lvcgk"]
|
||||||
|
[ext_resource type="Theme" uid="uid://ewgo3qi2xs54" path="res://data/themes/green_progress_bar_theme.tres" id="3_wvu2t"]
|
||||||
|
[ext_resource type="Theme" uid="uid://dm1sx57hw07cn" path="res://data/themes/blue_progress_bar_theme.tres" id="4_n8d17"]
|
||||||
|
|
||||||
|
[node name="HUD" type="CanvasLayer"]
|
||||||
|
script = ExtResource("1_yk6cu")
|
||||||
|
|
||||||
|
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||||
|
anchors_preset = 2
|
||||||
|
anchor_top = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_left = 16.0
|
||||||
|
offset_top = -184.0
|
||||||
|
offset_right = 64.0
|
||||||
|
offset_bottom = -24.0
|
||||||
|
grow_vertical = 0
|
||||||
|
|
||||||
|
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_constants/margin_left = 2
|
||||||
|
theme_override_constants/margin_top = 2
|
||||||
|
theme_override_constants/margin_right = 2
|
||||||
|
theme_override_constants/margin_bottom = 2
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="LivesContainer" type="GridContainer" parent="PanelContainer/MarginContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
columns = 3
|
||||||
|
|
||||||
|
[node name="TextureRect" type="TextureRect" parent="PanelContainer/MarginContainer/VBoxContainer/LivesContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
texture = ExtResource("2_4hybp")
|
||||||
|
|
||||||
|
[node name="TextureRect" type="TextureRect" parent="PanelContainer/MarginContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
texture = ExtResource("1_tsiui")
|
||||||
|
expand_mode = 4
|
||||||
|
stretch_mode = 4
|
||||||
|
|
||||||
|
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/MarginContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 3
|
||||||
|
|
||||||
|
[node name="PanelContainerRed" type="PanelContainer" parent="PanelContainer/MarginContainer/VBoxContainer/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="ProgressBar" type="ProgressBar" parent="PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/PanelContainerRed"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 1
|
||||||
|
theme = ExtResource("2_lvcgk")
|
||||||
|
max_value = 1.0
|
||||||
|
step = 0.1
|
||||||
|
value = 1.0
|
||||||
|
fill_mode = 3
|
||||||
|
show_percentage = false
|
||||||
|
|
||||||
|
[node name="PanelContainerGreen" type="PanelContainer" parent="PanelContainer/MarginContainer/VBoxContainer/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="ProgressBar" type="ProgressBar" parent="PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/PanelContainerGreen"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 1
|
||||||
|
theme = ExtResource("3_wvu2t")
|
||||||
|
max_value = 1.0
|
||||||
|
step = 0.1
|
||||||
|
value = 1.0
|
||||||
|
fill_mode = 3
|
||||||
|
show_percentage = false
|
||||||
|
|
||||||
|
[node name="PanelContainerBlue" type="PanelContainer" parent="PanelContainer/MarginContainer/VBoxContainer/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="ProgressBar" type="ProgressBar" parent="PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/PanelContainerBlue"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 1
|
||||||
|
theme = ExtResource("4_n8d17")
|
||||||
|
max_value = 1.0
|
||||||
|
step = 0.1
|
||||||
|
value = 1.0
|
||||||
|
fill_mode = 3
|
||||||
|
show_percentage = false
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
[gd_scene load_steps=7 format=3 uid="uid://b2amoasy4e08i"]
|
[gd_scene load_steps=11 format=3 uid="uid://b2amoasy4e08i"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://bsrmtons1ov7x" path="res://assets/maze.png" id="1_jp5wf"]
|
[ext_resource type="Texture2D" uid="uid://bsrmtons1ov7x" path="res://assets/maze.png" id="1_jp5wf"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cd57rr2jffwqu" path="res://scene/player.tscn" id="2_s6cts"]
|
[ext_resource type="Script" path="res://scripts/maze.gd" id="1_u2iw0"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c267u62jmp3dq" path="res://scene/chest.tscn" id="3_uyb5m"]
|
[ext_resource type="PackedScene" uid="uid://c267u62jmp3dq" path="res://scene/chest.tscn" id="3_uyb5m"]
|
||||||
|
[ext_resource type="Resource" uid="uid://djb1iyhb8gwqb" path="res://data/buffs/blue_buff.tres" id="4_2gr0s"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dcpeowc6xcfcv" path="res://scene/hud.tscn" id="4_7uel4"]
|
||||||
|
[ext_resource type="Resource" uid="uid://bo7k3kmsq57xy" path="res://data/buffs/green_buff.tres" id="5_ho55u"]
|
||||||
|
[ext_resource type="Resource" uid="uid://tiv2o1xk5g7e" path="res://data/buffs/red_buff.tres" id="6_ll7oj"]
|
||||||
|
|
||||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_e47fw"]
|
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_e47fw"]
|
||||||
texture = ExtResource("1_jp5wf")
|
texture = ExtResource("1_jp5wf")
|
||||||
@@ -67,6 +71,7 @@ sources/0 = SubResource("TileSetAtlasSource_e47fw")
|
|||||||
size = Vector2(64, 64)
|
size = Vector2(64, 64)
|
||||||
|
|
||||||
[node name="maze_1" type="Node2D"]
|
[node name="maze_1" type="Node2D"]
|
||||||
|
script = ExtResource("1_u2iw0")
|
||||||
|
|
||||||
[node name="TileMap" type="TileMap" parent="."]
|
[node name="TileMap" type="TileMap" parent="."]
|
||||||
tile_set = SubResource("TileSet_dy2x8")
|
tile_set = SubResource("TileSet_dy2x8")
|
||||||
@@ -99,43 +104,54 @@ shape = SubResource("RectangleShape2D_hodhv")
|
|||||||
position = Vector2(64, 224)
|
position = Vector2(64, 224)
|
||||||
shape = SubResource("RectangleShape2D_hodhv")
|
shape = SubResource("RectangleShape2D_hodhv")
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("2_s6cts")]
|
|
||||||
position = Vector2(144, 128)
|
|
||||||
|
|
||||||
[node name="ChestContainer" type="Node" parent="."]
|
[node name="ChestContainer" type="Node" parent="."]
|
||||||
|
|
||||||
[node name="Chest" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
[node name="Chest" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
||||||
position = Vector2(56, 328)
|
position = Vector2(56, 328)
|
||||||
|
buff = ExtResource("4_2gr0s")
|
||||||
|
|
||||||
[node name="Chest2" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
[node name="Chest2" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
||||||
position = Vector2(152, 184)
|
position = Vector2(152, 184)
|
||||||
|
buff = ExtResource("4_2gr0s")
|
||||||
|
|
||||||
[node name="Chest3" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
[node name="Chest3" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
||||||
position = Vector2(152, 88)
|
position = Vector2(152, 88)
|
||||||
|
buff = ExtResource("5_ho55u")
|
||||||
|
|
||||||
[node name="Chest4" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
[node name="Chest4" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
||||||
position = Vector2(248, -56)
|
position = Vector2(248, -56)
|
||||||
|
buff = ExtResource("5_ho55u")
|
||||||
|
|
||||||
[node name="Chest10" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
[node name="Chest10" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
||||||
position = Vector2(312, -72)
|
position = Vector2(312, -72)
|
||||||
|
buff = ExtResource("6_ll7oj")
|
||||||
|
|
||||||
[node name="Chest11" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
[node name="Chest11" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
||||||
position = Vector2(184, -72)
|
position = Vector2(184, -72)
|
||||||
|
buff = ExtResource("6_ll7oj")
|
||||||
|
|
||||||
[node name="Chest12" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
[node name="Chest12" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
||||||
position = Vector2(120, -56)
|
position = Vector2(120, -56)
|
||||||
|
buff = ExtResource("5_ho55u")
|
||||||
|
|
||||||
[node name="Chest5" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
[node name="Chest5" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
||||||
position = Vector2(-56, 40)
|
position = Vector2(-56, 40)
|
||||||
|
buff = ExtResource("5_ho55u")
|
||||||
|
|
||||||
[node name="Chest6" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
[node name="Chest6" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
||||||
position = Vector2(360, 232)
|
position = Vector2(360, 232)
|
||||||
|
buff = ExtResource("4_2gr0s")
|
||||||
|
|
||||||
[node name="Chest7" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
[node name="Chest7" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
||||||
position = Vector2(120, 344)
|
position = Vector2(120, 344)
|
||||||
|
buff = ExtResource("6_ll7oj")
|
||||||
|
|
||||||
[node name="Chest8" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
[node name="Chest8" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
||||||
position = Vector2(184, 328)
|
position = Vector2(184, 328)
|
||||||
|
buff = ExtResource("4_2gr0s")
|
||||||
|
|
||||||
[node name="Chest9" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
[node name="Chest9" parent="ChestContainer" instance=ExtResource("3_uyb5m")]
|
||||||
position = Vector2(-8, 344)
|
position = Vector2(-8, 344)
|
||||||
|
buff = ExtResource("6_ll7oj")
|
||||||
|
|
||||||
|
[node name="HUD" parent="." instance=ExtResource("4_7uel4")]
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
[gd_scene load_steps=4 format=3 uid="uid://cd57rr2jffwqu"]
|
[gd_scene load_steps=4 format=3 uid="uid://cd57rr2jffwqu"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/player.gd" id="1_yhpqp"]
|
[ext_resource type="Script" path="res://scripts/player.gd" id="1_veifk"]
|
||||||
[ext_resource type="Texture2D" uid="uid://d32ory5gus4lm" path="res://assets/dot.png" id="2_up8am"]
|
[ext_resource type="Texture2D" uid="uid://d32ory5gus4lm" path="res://assets/dot.png" id="2_up8am"]
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_c7wcn"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_c7wcn"]
|
||||||
radius = 6.0
|
radius = 6.0
|
||||||
|
|
||||||
[node name="Player" type="CharacterBody2D"]
|
[node name="Player" type="CharacterBody2D"]
|
||||||
script = ExtResource("1_yhpqp")
|
script = ExtResource("1_veifk")
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
texture = ExtResource("2_up8am")
|
texture = ExtResource("2_up8am")
|
||||||
|
|||||||
11
scripts/buff.gd
Normal file
11
scripts/buff.gd
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
extends Resource
|
||||||
|
class_name Buff
|
||||||
|
|
||||||
|
enum colors {
|
||||||
|
RED,
|
||||||
|
GREEN,
|
||||||
|
BLUE
|
||||||
|
}
|
||||||
|
|
||||||
|
@export var image: Texture2D
|
||||||
|
@export var color: colors
|
||||||
@@ -1 +1,20 @@
|
|||||||
extends StaticBody2D
|
extends StaticBody2D
|
||||||
|
class_name Chest
|
||||||
|
|
||||||
|
@export var buff: Buff
|
||||||
|
|
||||||
|
const CHEST_OPENED = preload("res://assets/chest_opened.png")
|
||||||
|
var recipients = []
|
||||||
|
var opened := false
|
||||||
|
|
||||||
|
func open(entity) -> Buff:
|
||||||
|
if not recipients.has(entity):
|
||||||
|
if not opened:
|
||||||
|
opened = true
|
||||||
|
$Sprite2D.texture = CHEST_OPENED
|
||||||
|
var buff_texture := Sprite2D.new()
|
||||||
|
buff_texture.texture = buff.image
|
||||||
|
add_child(buff_texture)
|
||||||
|
recipients.append(entity)
|
||||||
|
return buff
|
||||||
|
return null
|
||||||
|
|||||||
37
scripts/enemy.gd
Normal file
37
scripts/enemy.gd
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
extends CharacterBody2D
|
||||||
|
class_name Enemy
|
||||||
|
|
||||||
|
@onready var sprite_2d: Sprite2D = $Sprite2D
|
||||||
|
|
||||||
|
var color := Color.WHITE
|
||||||
|
@export var speed = 100
|
||||||
|
var lives: int = 1
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
velocity = Vector2.ZERO
|
||||||
|
if Input.is_action_pressed("ui_down"):
|
||||||
|
velocity += Vector2.DOWN
|
||||||
|
if Input.is_action_pressed("ui_up"):
|
||||||
|
velocity += Vector2.UP
|
||||||
|
if Input.is_action_pressed("ui_left"):
|
||||||
|
velocity += Vector2.LEFT
|
||||||
|
if Input.is_action_pressed("ui_right"):
|
||||||
|
velocity += Vector2.RIGHT
|
||||||
|
velocity = velocity.normalized() * speed
|
||||||
|
move_and_slide()
|
||||||
|
for i in range(get_slide_collision_count()):
|
||||||
|
var collision := get_slide_collision(i)
|
||||||
|
if collision.get_collider() is Chest:
|
||||||
|
var buff: Buff = collision.get_collider().open(self)
|
||||||
|
if buff:
|
||||||
|
match(buff.color):
|
||||||
|
buff.colors.RED:
|
||||||
|
lives += 1
|
||||||
|
color.r -= 0.25
|
||||||
|
buff.colors.GREEN:
|
||||||
|
#$Camera2D.zoom -= Vector2(0.4, 0.4)
|
||||||
|
color.g -= 0.25
|
||||||
|
buff.colors.BLUE:
|
||||||
|
speed += 12
|
||||||
|
color.b -= 0.25
|
||||||
|
sprite_2d.modulate = color
|
||||||
25
scripts/hud.gd
Normal file
25
scripts/hud.gd
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
extends CanvasLayer
|
||||||
|
class_name HUD
|
||||||
|
|
||||||
|
@onready var progress_bar_red: ProgressBar = $PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/PanelContainerRed/ProgressBar
|
||||||
|
@onready var progress_bar_green: ProgressBar = $PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/PanelContainerGreen/ProgressBar
|
||||||
|
@onready var progress_bar_blue: ProgressBar = $PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/PanelContainerBlue/ProgressBar
|
||||||
|
@onready var texture_rect: TextureRect = $PanelContainer/MarginContainer/VBoxContainer/TextureRect
|
||||||
|
@onready var lives_container: GridContainer = $PanelContainer/MarginContainer/VBoxContainer/LivesContainer
|
||||||
|
const HEART = preload("res://assets/heart.png")
|
||||||
|
|
||||||
|
func _on_player_color_changed(color: Color) -> void:
|
||||||
|
progress_bar_red.value = color.r
|
||||||
|
progress_bar_green.value = color.g
|
||||||
|
progress_bar_blue.value = color.b
|
||||||
|
texture_rect.modulate = color
|
||||||
|
|
||||||
|
|
||||||
|
func _on_player_lives_changed(lives: int) -> void:
|
||||||
|
var heart_containers = lives_container.get_children()
|
||||||
|
if heart_containers.size() < lives:
|
||||||
|
var life = TextureRect.new()
|
||||||
|
life.texture = HEART
|
||||||
|
lives_container.add_child(life)
|
||||||
|
elif heart_containers.size() > lives:
|
||||||
|
heart_containers.pop_back().queue_free()
|
||||||
30
scripts/maze.gd
Normal file
30
scripts/maze.gd
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
extends Node2D
|
||||||
|
class_name Maze
|
||||||
|
|
||||||
|
const PLAYER = preload("res://scene/player.tscn")
|
||||||
|
const ENEMY = preload("res://scene/enemy.tscn")
|
||||||
|
|
||||||
|
var spawn_locations: Array[Vector2] = []
|
||||||
|
|
||||||
|
@onready var hud: HUD = $HUD
|
||||||
|
@onready var spawn_zones: Node2D = $SpawnZones
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
var spawn_zone_array := spawn_zones.get_children()
|
||||||
|
for spawn_zone in spawn_zone_array:
|
||||||
|
var zone := spawn_zone.get_child(0) as CollisionShape2D
|
||||||
|
var top_left = zone.transform.get_origin() - Vector2(24, 24)
|
||||||
|
for x in range(zone.shape.size.x / 16):
|
||||||
|
for y in range(zone.shape.size.y / 16):
|
||||||
|
spawn_locations.append(top_left + Vector2(x * 16, y * 16))
|
||||||
|
var player_loc: Vector2 = spawn_locations.pick_random()
|
||||||
|
for spawn in spawn_locations:
|
||||||
|
var entity
|
||||||
|
if spawn == player_loc:
|
||||||
|
entity = PLAYER.instantiate()
|
||||||
|
entity.color_changed.connect(hud._on_player_color_changed)
|
||||||
|
entity.lives_changed.connect(hud._on_player_lives_changed)
|
||||||
|
else:
|
||||||
|
entity = ENEMY.instantiate()
|
||||||
|
entity.position = spawn
|
||||||
|
add_child(entity)
|
||||||
@@ -1,7 +1,14 @@
|
|||||||
extends CharacterBody2D
|
extends CharacterBody2D
|
||||||
class_name Player
|
class_name Player
|
||||||
|
|
||||||
|
signal color_changed(color: Color)
|
||||||
|
signal lives_changed(lives: int)
|
||||||
|
|
||||||
|
@onready var sprite_2d: Sprite2D = $Sprite2D
|
||||||
|
|
||||||
|
var color := Color.WHITE
|
||||||
@export var speed = 100
|
@export var speed = 100
|
||||||
|
var lives: int = 1
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
velocity = Vector2.ZERO
|
velocity = Vector2.ZERO
|
||||||
@@ -15,3 +22,21 @@ func _physics_process(delta: float) -> void:
|
|||||||
velocity += Vector2.RIGHT
|
velocity += Vector2.RIGHT
|
||||||
velocity = velocity.normalized() * speed
|
velocity = velocity.normalized() * speed
|
||||||
move_and_slide()
|
move_and_slide()
|
||||||
|
for i in range(get_slide_collision_count()):
|
||||||
|
var collision := get_slide_collision(i)
|
||||||
|
if collision.get_collider() is Chest:
|
||||||
|
var buff: Buff = collision.get_collider().open(self)
|
||||||
|
if buff:
|
||||||
|
match(buff.color):
|
||||||
|
buff.colors.RED:
|
||||||
|
lives += 1
|
||||||
|
color.r -= 0.25
|
||||||
|
lives_changed.emit(lives)
|
||||||
|
buff.colors.GREEN:
|
||||||
|
$Camera2D.zoom -= Vector2(0.4, 0.4)
|
||||||
|
color.g -= 0.25
|
||||||
|
buff.colors.BLUE:
|
||||||
|
speed += 12
|
||||||
|
color.b -= 0.25
|
||||||
|
sprite_2d.modulate = color
|
||||||
|
color_changed.emit(color)
|
||||||
|
|||||||
Reference in New Issue
Block a user