Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wire up start menu to be the first thing the player sees #52

Merged
merged 1 commit into from
Apr 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions Sick_Day_Delivery/HUD.tscn

This file was deleted.

2 changes: 1 addition & 1 deletion Sick_Day_Delivery/Scenes/HUD.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ animations = [{
"speed": 10.0
}]

[node name="HUD2" type="CanvasLayer"]
[node name="HUD" type="CanvasLayer"]
script = ExtResource("1_qxxad")

[node name="EnemyCounter" type="Control" parent="."]
Expand Down
134 changes: 95 additions & 39 deletions Sick_Day_Delivery/Scenes/StartMenu.tscn
Original file line number Diff line number Diff line change
@@ -1,63 +1,119 @@
[gd_scene format=3 uid="uid://draeoultri5r3"]
[gd_scene load_steps=10 format=3 uid="uid://draeoultri5r3"]

[ext_resource type="Texture2D" uid="uid://bgfxom1a4pd4b" path="res://Sprites/Pill_PlaceholderOpen.png" id="1_m26p8"]
[ext_resource type="Script" path="res://Scripts/start_menu.gd" id="1_uv6ll"]
[ext_resource type="Texture2D" uid="uid://dpsrjkbs785cv" path="res://Sprites/Pill_PlaceholderClosing.png" id="2_j8852"]
[ext_resource type="Theme" uid="uid://dv2a4y6esjmj8" path="res://default_theme.tres" id="2_se7hk"]
[ext_resource type="Texture2D" uid="uid://dpxwmtk4ldmci" path="res://Sprites/Pill_PlaceholderBlink.png" id="3_qxvwk"]
[ext_resource type="PackedScene" uid="uid://cy8wae7f4lg5e" path="res://Scenes/audio.tscn" id="5_8lu0s"]

[sub_resource type="Gradient" id="Gradient_t1k70"]
offsets = PackedFloat32Array(0, 0.0645161, 1)
colors = PackedColorArray(0, 0.278431, 0.337255, 1, 0, 0.278431, 0.337255, 1, 0, 0.172549, 0.337255, 1)

[sub_resource type="GradientTexture2D" id="GradientTexture2D_1ow06"]
gradient = SubResource("Gradient_t1k70")
width = 1920
height = 1020
fill_from = Vector2(0.665138, 0.793578)
fill_to = Vector2(0.458716, 0)

[sub_resource type="SpriteFrames" id="SpriteFrames_pan22"]
animations = [{
"frames": [{
"duration": 15.0,
"texture": ExtResource("1_m26p8")
}, {
"duration": 0.75,
"texture": ExtResource("2_j8852")
}, {
"duration": 1.0,
"texture": ExtResource("3_qxvwk")
}, {
"duration": 0.75,
"texture": ExtResource("2_j8852")
}, {
"duration": 15.0,
"texture": ExtResource("1_m26p8")
}],
"loop": true,
"name": &"default",
"speed": 10.0
}]

[node name="StartMenu" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
anchors_preset = 0
script = ExtResource("1_uv6ll")

[node name="Background" type="TextureRect" parent="."]
layout_mode = 1
[node name="Canvas" type="CanvasLayer" parent="."]
follow_viewport_enabled = true

[node name="Background" type="TextureRect" parent="Canvas"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
scale = Vector2(1, 0.994)
texture = SubResource("GradientTexture2D_1ow06")

[node name="Title" type="Label" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_top = 0.066
anchor_right = 1.003
anchor_bottom = 1.0
offset_top = 0.231998
offset_right = 0.543945
[node name="Title" type="Label" parent="Canvas"]
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 280.0
grow_horizontal = 2
grow_vertical = 2
scale = Vector2(0.99437, 0.983871)
theme_override_font_sizes/font_size = 100
text = "Sick Day
Delivery"
horizontal_alignment = 1
autowrap_mode = 2

[node name="StartButton" type="Button" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.391
anchor_top = 0.566
anchor_right = 0.604
anchor_bottom = 0.718
offset_left = 0.567963
offset_top = 2.23196
offset_right = 19.192
offset_bottom = -0.264038
[node name="StartButton" type="Button" parent="Canvas"]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -160.0
offset_top = -65.0
offset_right = 140.0
offset_bottom = 35.0
grow_horizontal = 2
grow_vertical = 2
scale = Vector2(1.01, 1)
theme = ExtResource("2_se7hk")
theme_override_font_sizes/font_size = 64
text = "Start"

[node name="HowToPlay" type="Button" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.372
anchor_top = 0.765
anchor_right = 0.635
anchor_bottom = 0.927
offset_left = -0.544006
offset_top = 0.279968
offset_right = 0.479919
offset_bottom = 0.303955
[node name="HowToPlay" type="Button" parent="Canvas"]
visible = false
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -160.0
offset_top = 110.0
offset_right = 140.0
offset_bottom = 210.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
size_flags_vertical = 4
theme = ExtResource("2_se7hk")
theme_override_font_sizes/font_size = 64
text = "Controls"

[node name="Pill" type="AnimatedSprite2D" parent="Canvas"]
position = Vector2(332, 242)
rotation = -0.2654
scale = Vector2(1.7, 1.7)
sprite_frames = SubResource("SpriteFrames_pan22")
frame_progress = 0.98429

[node name="audio" parent="." instance=ExtResource("5_8lu0s")]

[connection signal="pressed" from="Canvas/StartButton" to="." method="_on_start_button_pressed"]
[connection signal="pressed" from="Canvas/HowToPlay" to="." method="_on_how_to_play_pressed"]
1 change: 1 addition & 0 deletions Sick_Day_Delivery/Scenes/audio.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[node name="BackgroundMusic" type="AudioStreamPlayer" parent="."]
process_priority = 10
stream = ExtResource("1_wp0ic")
autoplay = true
bus = &"Music"

[node name="Ambience" type="AudioStreamPlayer" parent="."]
Expand Down
5 changes: 2 additions & 3 deletions Sick_Day_Delivery/Scenes/main.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=3 uid="uid://b4xi3mlkhu4ow"]
[gd_scene load_steps=9 format=3 uid="uid://b4xi3mlkhu4ow"]

[ext_resource type="PackedScene" uid="uid://bhh5dmfulsc0f" path="res://Scenes/body_map.tscn" id="1_6xrru"]
[ext_resource type="Script" path="res://Scripts/main.gd" id="1_mnr5t"]
Expand All @@ -8,12 +8,12 @@
[ext_resource type="PackedScene" uid="uid://cy8wae7f4lg5e" path="res://Scenes/audio.tscn" id="6_cs0yl"]
[ext_resource type="PackedScene" uid="uid://dp4x40y3bkvxf" path="res://Scenes/global_state.tscn" id="7_3cwkh"]
[ext_resource type="PackedScene" uid="uid://by2kd0e26letn" path="res://Scenes/HUD.tscn" id="7_ui1jt"]
[ext_resource type="PackedScene" uid="uid://cl3gneduvqjdn" path="res://Scenes/colony.tscn" id="9_iwfvv"]

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

[node name="Body Map" parent="." instance=ExtResource("1_6xrru")]
texture_filter = 2
position = Vector2(1526, 2505)

[node name="audio" parent="." instance=ExtResource("6_cs0yl")]
Expand All @@ -36,7 +36,6 @@ scale = Vector2(0.35, 0.35)
colony_count = 3
spawn_rate = 6
spawn_chance = 0.225
colony = ExtResource("9_iwfvv")

[connection signal="on_enemy_ded" from="Bacterium" to="Global State" method="report_enemy_destroyed"]
[connection signal="on_enemies_destroyed_updated" from="Global State" to="HUD" method="display_enemies_destroyed"]
14 changes: 14 additions & 0 deletions Sick_Day_Delivery/Scripts/start_menu.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
extends Control

signal game_started
signal view_how_to_play

func _ready():
$Canvas.visible = true;

func _on_start_button_pressed():
get_tree().change_scene_to_file("res://Scenes/main.tscn")


func _on_how_to_play_pressed():
emit_signal("view_how_to_play")
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ 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
detect_3d/compress_to=0
7 changes: 7 additions & 0 deletions Sick_Day_Delivery/default_theme.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[gd_resource type="Theme" load_steps=2 format=3 uid="uid://dv2a4y6esjmj8"]

[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_3d5kq"]

[resource]
Button/fonts/font = null
Button/styles/hover = SubResource("StyleBoxTexture_3d5kq")
6 changes: 3 additions & 3 deletions Sick_Day_Delivery/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ config_version=5
[application]

config/name="Sick_Day_Delivery"
run/main_scene="res://Scenes/main.tscn"
run/main_scene="res://Scenes/StartMenu.tscn"
config/features=PackedStringArray("4.0", "GL Compatibility")
boot_splash/bg_color=Color(0.0156863, 0.164706, 0.172549, 1)
boot_splash/image="res://Sprites/Pill_PlaceholderOpen.png"
Expand All @@ -25,8 +25,8 @@ driver/output_latency.web=20

[display]

window/size/viewport_width=3000
window/size/viewport_height=5000
window/size/viewport_width=1920
window/size/viewport_height=1080

[dotnet]

Expand Down