Skip to content

Commit

Permalink
Merge pull request #18 from rasmussvala/World-and-level-select
Browse files Browse the repository at this point in the history
World and level select
  • Loading branch information
rasmussvala authored Oct 7, 2024
2 parents e144cf5 + 3ca1a26 commit feb2034
Show file tree
Hide file tree
Showing 31 changed files with 782 additions and 35 deletions.
Binary file added assets/characters/mouse/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/collectibles/pills/idle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ config/name="TDDD23-Game-Project"
run/main_scene="res://scenes/menus/main_menu.tscn"
config/features=PackedStringArray("4.3", "Forward Plus")

[autoload]

game_data="*res://scripts/game_data.gd"
functions="*res://scripts/functions.gd"

[file_customization]

folder_colors={
Expand Down
85 changes: 85 additions & 0 deletions scenes/collectibles/pill.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
[gd_scene load_steps=13 format=3 uid="uid://d4bboajpgnlfq"]

[ext_resource type="Texture2D" uid="uid://c4uxwp45gteo2" path="res://assets/collectibles/pills/idle.png" id="1_ob80m"]
[ext_resource type="Script" path="res://scripts/collectibles/pill.gd" id="1_uuhij"]

[sub_resource type="AtlasTexture" id="AtlasTexture_jgb45"]
atlas = ExtResource("1_ob80m")
region = Rect2(0, 0, 32, 32)

[sub_resource type="AtlasTexture" id="AtlasTexture_h1ywm"]
atlas = ExtResource("1_ob80m")
region = Rect2(32, 0, 32, 32)

[sub_resource type="AtlasTexture" id="AtlasTexture_d8ddf"]
atlas = ExtResource("1_ob80m")
region = Rect2(64, 0, 32, 32)

[sub_resource type="AtlasTexture" id="AtlasTexture_vuf4j"]
atlas = ExtResource("1_ob80m")
region = Rect2(96, 0, 32, 32)

[sub_resource type="AtlasTexture" id="AtlasTexture_okdsu"]
atlas = ExtResource("1_ob80m")
region = Rect2(128, 0, 32, 32)

[sub_resource type="AtlasTexture" id="AtlasTexture_x3pwa"]
atlas = ExtResource("1_ob80m")
region = Rect2(160, 0, 32, 32)

[sub_resource type="AtlasTexture" id="AtlasTexture_74x4m"]
atlas = ExtResource("1_ob80m")
region = Rect2(192, 0, 32, 32)

[sub_resource type="AtlasTexture" id="AtlasTexture_awqvx"]
atlas = ExtResource("1_ob80m")
region = Rect2(224, 0, 32, 32)

[sub_resource type="SpriteFrames" id="SpriteFrames_kmxvc"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_jgb45")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_h1ywm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_d8ddf")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vuf4j")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_okdsu")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_x3pwa")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_74x4m")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_awqvx")
}],
"loop": true,
"name": &"idle",
"speed": 10.0
}]

[sub_resource type="CircleShape2D" id="CircleShape2D_ml5hj"]
radius = 8.0

[node name="pill" type="Area2D"]
collision_mask = 2
script = ExtResource("1_uuhij")

[node name="animated_sprite_pill" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_kmxvc")
animation = &"idle"
autoplay = "idle"

[node name="collision" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_ml5hj")

[connection signal="body_entered" from="." to="." method="_on_body_entered"]
10 changes: 6 additions & 4 deletions scenes/levels/demo_level.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[gd_scene load_steps=13 format=4 uid="uid://dni2huswsn7rp"]
[gd_scene load_steps=14 format=4 uid="uid://dni2huswsn7rp"]

[ext_resource type="PackedScene" uid="uid://y16vsgpfcas8" path="res://scenes/tools/tile_map_layers/room_layer.tscn" id="1_3im0l"]
[ext_resource type="Script" path="res://scripts/levels/demo_level.gd" id="1_bkpxm"]
[ext_resource type="Script" path="res://scripts/game_manager.gd" id="1_k3ck1"]
[ext_resource type="PackedScene" uid="uid://bpw6urgdij01f" path="res://scenes/menus/win_menu.tscn" id="1_v7lt3"]
[ext_resource type="PackedScene" uid="uid://c74xlu0of2unm" path="res://scenes/tools/tile_map_layers/furniture_layer.tscn" id="2_38877"]
Expand All @@ -14,6 +15,7 @@
[ext_resource type="PackedScene" uid="uid://b6pkedphn6qas" path="res://scenes/characters/enemies/bug_green.tscn" id="6_itwjh"]

[node name="demo_level" type="Node2D"]
script = ExtResource("1_bkpxm")

[node name="win_menu" parent="." instance=ExtResource("1_v7lt3")]
unique_name_in_owner = true
Expand Down Expand Up @@ -58,12 +60,12 @@ position = Vector2(656, -48)
[node name="bug_green_2" parent="enemies" instance=ExtResource("6_itwjh")]
position = Vector2(656, 16)

[node name="collectibles" type="Node" parent="."]
[node name="cheeses" type="Node" parent="."]

[node name="cheese_1" parent="collectibles" instance=ExtResource("5_5gdem")]
[node name="cheese_1" parent="cheeses" groups=["Cheeses"] instance=ExtResource("5_5gdem")]
position = Vector2(400, -16)

[node name="cheese_2" parent="collectibles" instance=ExtResource("5_5gdem")]
[node name="cheese_2" parent="cheeses" groups=["Cheeses"] instance=ExtResource("5_5gdem")]
position = Vector2(656, -16)

[node name="obstacles" type="Node" parent="."]
Expand Down
8 changes: 7 additions & 1 deletion scenes/levels/game.tscn
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[gd_scene load_steps=17 format=4 uid="uid://b3wdmox28pm05"]
[gd_scene load_steps=19 format=4 uid="uid://b3wdmox28pm05"]

[ext_resource type="Script" path="res://scripts/levels/game.gd" id="1_5w8s8"]
[ext_resource type="Script" path="res://scripts/game_manager.gd" id="1_sqrlk"]
[ext_resource type="PackedScene" uid="uid://bpw6urgdij01f" path="res://scenes/menus/win_menu.tscn" id="2_1la2g"]
[ext_resource type="PackedScene" uid="uid://86tsdexohbg4" path="res://scenes/menus/death_menu.tscn" id="2_wlcxk"]
Expand All @@ -12,6 +13,7 @@
[ext_resource type="PackedScene" uid="uid://cagii1m6affwl" path="res://scenes/tools/tile_map_layers/decoration_layer.tscn" id="7_3xtj4"]
[ext_resource type="PackedScene" uid="uid://cs03yq5n5ibww" path="res://scenes/characters/enemies/pit.tscn" id="7_5m25o"]
[ext_resource type="PackedScene" uid="uid://be61rj1jagrum" path="res://scenes/characters/enemies/bug_blue.tscn" id="8_b8f1k"]
[ext_resource type="PackedScene" uid="uid://d4bboajpgnlfq" path="res://scenes/collectibles/pill.tscn" id="9_j6jwb"]
[ext_resource type="PackedScene" uid="uid://dcfj1ji8t2a6c" path="res://scenes/characters/enemies/mouse_trap.tscn" id="11_p0wvp"]
[ext_resource type="PackedScene" uid="uid://bw5xityvbf8d2" path="res://scenes/characters/enemies/bug_flying.tscn" id="11_soepf"]
[ext_resource type="PackedScene" uid="uid://bd00qhbwn5hyd" path="res://scenes/characters/enemies/bug_flying_shooter.tscn" id="15_rs0q6"]
Expand All @@ -20,6 +22,7 @@
size = Vector2(32, 32)

[node name="game" type="Node2D"]
script = ExtResource("1_5w8s8")

[node name="game_manager" type="Node" parent="."]
unique_name_in_owner = true
Expand Down Expand Up @@ -57,6 +60,9 @@ debug_color = Color(0.961248, 0, 0.511433, 0.42)

[node name="cheeses" type="Node" parent="."]

[node name="pill_1" parent="cheeses" instance=ExtResource("9_j6jwb")]
position = Vector2(48, -176)

[node name="cheese_1" parent="cheeses" groups=["Cheeses"] instance=ExtResource("6_prwsy")]
position = Vector2(-16, -48)

Expand Down
20 changes: 19 additions & 1 deletion scenes/menus/death_menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,24 @@ grow_horizontal = 2
grow_vertical = 2
theme_override_fonts/font = ExtResource("1_vrx8g")
theme_override_font_sizes/font_size = 32
text = "Play Again"
text = "Restart level"

[node name="back_button" type="Button" parent="window"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -130.0
offset_top = 116.0
offset_right = 130.0
offset_bottom = 156.0
grow_horizontal = 2
grow_vertical = 2
theme_override_fonts/font = ExtResource("1_vrx8g")
theme_override_font_sizes/font_size = 32
text = "Return to level select"

[connection signal="pressed" from="window/restart_button" to="." method="_on_restart_button_pressed"]
[connection signal="pressed" from="window/back_button" to="." method="_on_back_button_pressed"]
36 changes: 36 additions & 0 deletions scenes/menus/level_icon.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[gd_scene load_steps=5 format=3 uid="uid://xkbgidfk0x0m"]

[ext_resource type="Script" path="res://scripts/menus/level_icon.gd" id="1_tru2s"]
[ext_resource type="FontFile" uid="uid://dwxiyviu3pln4" path="res://assets/tools/fonts/PixelOperator8.ttf" id="2_6dorg"]

[sub_resource type="Gradient" id="Gradient_du2fs"]
offsets = PackedFloat32Array(0)
colors = PackedColorArray(0, 0, 0, 1)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_hnmxo"]
gradient = SubResource("Gradient_du2fs")
width = 64

[node name="level_icon" type="Control"]
layout_mode = 3
anchors_preset = 0
offset_right = 64.0
offset_bottom = 64.0
pivot_offset = Vector2(32, 32)
script = ExtResource("1_tru2s")

[node name="label" type="Label" parent="."]
layout_mode = 0
offset_left = -14.0
offset_top = -16.0
offset_right = 78.0
offset_bottom = 7.0
theme_override_fonts/font = ExtResource("2_6dorg")
theme_override_font_sizes/font_size = 16
text = "Level 1"

[node name="texture_rect" type="TextureRect" parent="."]
layout_mode = 0
offset_right = 64.0
offset_bottom = 64.0
texture = SubResource("GradientTexture1D_hnmxo")
76 changes: 76 additions & 0 deletions scenes/menus/level_select_world_1.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[gd_scene load_steps=4 format=3 uid="uid://pckx6wtppot6"]

[ext_resource type="Script" path="res://scripts/menus/level_select.gd" id="1_uc3rh"]
[ext_resource type="PackedScene" uid="uid://xkbgidfk0x0m" path="res://scenes/menus/level_icon.tscn" id="2_m0ttj"]
[ext_resource type="PackedScene" uid="uid://beqv3mlfudjby" path="res://scenes/menus/player_icon.tscn" id="3_n6nib"]

[node name="level_select" type="Control"]
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_uc3rh")

[node name="level_icon1" parent="." node_paths=PackedStringArray("next_level_right") instance=ExtResource("2_m0ttj")]
offset_left = 128.0
offset_top = 448.0
offset_right = 192.0
offset_bottom = 512.0
next_scene_path = "res://scenes/levels/game.tscn"
next_level_right = NodePath("../level_icon2")

[node name="level_icon2" parent="." node_paths=PackedStringArray("next_level_up", "next_level_left", "next_level_right") instance=ExtResource("2_m0ttj")]
offset_left = 320.0
offset_top = 320.0
offset_right = 384.0
offset_bottom = 384.0
level_name = "2"
next_scene_path = "res://scenes/levels/demo_level.tscn"
next_level_up = NodePath("../level_icon2B")
next_level_left = NodePath("../level_icon1")
next_level_right = NodePath("../level_icon3")

[node name="level_icon2B" parent="." node_paths=PackedStringArray("next_level_down") instance=ExtResource("2_m0ttj")]
offset_left = 320.0
offset_top = 128.0
offset_right = 384.0
offset_bottom = 192.0
level_name = "2B"
next_level_down = NodePath("../level_icon2")

[node name="level_icon3" parent="." node_paths=PackedStringArray("next_level_left", "next_level_right") instance=ExtResource("2_m0ttj")]
offset_left = 512.0
offset_top = 384.0
offset_right = 576.0
offset_bottom = 448.0
level_name = "3"
next_level_left = NodePath("../level_icon2")
next_level_right = NodePath("../level_icon4")

[node name="level_icon4" parent="." node_paths=PackedStringArray("next_level_left", "next_level_right") instance=ExtResource("2_m0ttj")]
offset_left = 640.0
offset_top = 192.0
offset_right = 704.0
offset_bottom = 256.0
level_name = "4"
next_level_left = NodePath("../level_icon3")
next_level_right = NodePath("../level_icon5")

[node name="level_icon5" parent="." node_paths=PackedStringArray("next_level_left", "next_level_right") instance=ExtResource("2_m0ttj")]
offset_left = 832.0
offset_top = 384.0
offset_right = 896.0
offset_bottom = 448.0
level_name = "5"
next_level_left = NodePath("../level_icon4")
next_level_right = NodePath("../level_icon6")

[node name="level_icon6" parent="." node_paths=PackedStringArray("next_level_left") instance=ExtResource("2_m0ttj")]
offset_left = 960.0
offset_top = 192.0
offset_right = 1024.0
offset_bottom = 256.0
level_name = "6"
next_level_left = NodePath("../level_icon5")

[node name="player_icon" parent="." instance=ExtResource("3_n6nib")]
layout_mode = 0
rotation = 0.0
47 changes: 47 additions & 0 deletions scenes/menus/level_select_world_2.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[gd_scene load_steps=4 format=3 uid="uid://ipb3wj586xgu"]

[ext_resource type="Script" path="res://scripts/menus/level_select.gd" id="1_t04jg"]
[ext_resource type="PackedScene" uid="uid://xkbgidfk0x0m" path="res://scenes/menus/level_icon.tscn" id="2_qaot5"]
[ext_resource type="PackedScene" uid="uid://beqv3mlfudjby" path="res://scenes/menus/player_icon.tscn" id="3_aofpu"]

[node name="level_select" type="Control"]
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_t04jg")

[node name="level_icon1" parent="." node_paths=PackedStringArray("next_level_right") instance=ExtResource("2_qaot5")]
offset_left = 128.0
offset_top = 320.0
offset_right = 192.0
offset_bottom = 384.0
next_level_right = NodePath("../level_icon2")

[node name="level_icon2" parent="." node_paths=PackedStringArray("next_level_left", "next_level_right") instance=ExtResource("2_qaot5")]
offset_left = 320.0
offset_top = 192.0
offset_right = 384.0
offset_bottom = 256.0
level_name = "2"
next_level_left = NodePath("../level_icon1")
next_level_right = NodePath("../level_icon3")

[node name="level_icon3" parent="." node_paths=PackedStringArray("next_level_left", "next_level_right") instance=ExtResource("2_qaot5")]
offset_left = 512.0
offset_top = 320.0
offset_right = 576.0
offset_bottom = 384.0
level_name = "3"
next_level_left = NodePath("../level_icon2")
next_level_right = NodePath("../level_icon4")

[node name="level_icon4" parent="." node_paths=PackedStringArray("next_level_left") instance=ExtResource("2_qaot5")]
offset_left = 704.0
offset_top = 192.0
offset_right = 768.0
offset_bottom = 256.0
level_name = "4"
next_level_left = NodePath("../level_icon3")

[node name="player_icon" parent="." instance=ExtResource("3_aofpu")]
layout_mode = 0
rotation = 0.0
Loading

0 comments on commit feb2034

Please sign in to comment.