diff --git a/audio/music/74(game_over).ogg b/audio/music/74(game_over).ogg new file mode 100644 index 0000000..33ba2c0 Binary files /dev/null and b/audio/music/74(game_over).ogg differ diff --git a/audio/music/74(game_over).ogg.import b/audio/music/74(game_over).ogg.import new file mode 100644 index 0000000..178af66 --- /dev/null +++ b/audio/music/74(game_over).ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/74(game_over).ogg-c8daa270fc6254ebdb545c9163121582.oggstr" + +[deps] + +source_file="res://audio/music/74(game_over).ogg" +dest_files=[ "res://.import/74(game_over).ogg-c8daa270fc6254ebdb545c9163121582.oggstr" ] + +[params] + +loop=false +loop_offset=0 diff --git a/autoloads/debug.gd b/autoloads/debug.gd index 1d1b0c4..5e4286c 100644 --- a/autoloads/debug.gd +++ b/autoloads/debug.gd @@ -181,3 +181,7 @@ func _enter_code(): dir.list_dir_end() "SKELETON": Game.keys = 50 + "GOVERMAN": + var map = get_tree().get_nodes_in_group("map").pop_back() + var gover = load("res://menus/game_over.tscn").instance() + map.add_child(gover) diff --git a/menus/game_over.gd b/menus/game_over.gd new file mode 100644 index 0000000..e74ed28 --- /dev/null +++ b/menus/game_over.gd @@ -0,0 +1,18 @@ +extends Node + +onready var retry_button = $Panel/Retry +onready var exit_button = $Panel/Exit + +# Called when the node enters the scene tree for the first time. +func _ready(): + get_tree().paused = true + retry_button.grab_focus() + +func _on_Exit_button_down(): + get_tree().paused = false + SceneManager.current_scene = load("res://menus/level_select_scholar.tscn").instance() + + +func _on_Retry_button_down(): + get_tree().paused = true + Game.restart_level() diff --git a/menus/game_over.tscn b/menus/game_over.tscn new file mode 100644 index 0000000..0a0b03f --- /dev/null +++ b/menus/game_over.tscn @@ -0,0 +1,103 @@ +[gd_scene load_steps=11 format=2] + +[ext_resource path="res://shaders/ska_plane.gdshader" type="Shader" id=1] +[ext_resource path="res://objects/hud/3d_text.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/theme.tres" type="Theme" id=3] +[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=4] +[ext_resource path="res://graphics/hud/pause_arrow.png" type="Texture" id=5] +[ext_resource path="res://shaders/wibble_wobble.gdshader" type="Shader" id=6] +[ext_resource path="res://objects/hud/menu_sounds.tscn" type="PackedScene" id=7] +[ext_resource path="res://menus/game_over.gd" type="Script" id=8] + +[sub_resource type="ShaderMaterial" id=1] +shader = ExtResource( 1 ) +shader_param/color_1 = Color( 0.305882, 0.305882, 0.305882, 1 ) +shader_param/color_2 = Color( 0.223529, 0.223529, 0.223529, 1 ) +shader_param/checker_size = Vector2( 16, 8 ) +shader_param/pan_speed = Vector2( 16, 0 ) +shader_param/cycle_speed = Vector2( 1, 0 ) +shader_param/cycle_alternation = Vector2( 16, 0 ) +shader_param/uv_transform = Transform2D( 1, 1, 0, 1, 0, 0 ) + +[sub_resource type="ShaderMaterial" id=10] +shader = ExtResource( 6 ) +shader_param/speed = Vector2( 4, 8 ) +shader_param/ammount = Vector2( 1, 1 ) +shader_param/offset = Vector2( 0, 0 ) +shader_param/delay = Vector2( 0, 0 ) + +[node name="Node" type="Node"] +script = ExtResource( 8 ) + +[node name="ColorRect" type="ColorRect" parent="."] +material = SubResource( 1 ) +margin_right = 256.0 +margin_bottom = 192.0 + +[node name="Panel" type="Panel" parent="."] +margin_left = 72.0 +margin_top = 96.0 +margin_right = 184.0 +margin_bottom = 136.0 +theme = ExtResource( 3 ) +__meta__ = { +"_edit_group_": true +} + +[node name="Label" type="Label" parent="Panel"] +material = ExtResource( 4 ) +margin_left = 16.0 +margin_top = 8.0 +margin_right = 93.0 +margin_bottom = 44.0 +text = "RETRY LEVEL +EXIT TO MAP +" + +[node name="Retry" type="TextureButton" parent="Panel"] +material = SubResource( 10 ) +margin_left = 8.0 +margin_top = 8.0 +margin_right = 16.0 +margin_bottom = 16.0 +texture_focused = ExtResource( 5 ) + +[node name="Exit" type="TextureButton" parent="Panel"] +material = SubResource( 10 ) +margin_left = 8.0 +margin_top = 21.0 +margin_right = 16.0 +margin_bottom = 29.0 +texture_focused = ExtResource( 5 ) + +[node name="MenuSounds" parent="." instance=ExtResource( 7 )] + +[node name="Label" type="Label" parent="."] +material = ExtResource( 4 ) +margin_top = 59.0 +margin_right = 256.0 +margin_bottom = 82.0 +theme = ExtResource( 3 ) +text = "In reality, the game is +only over when you give up" +align = 1 + +[node name="Label2" type="Label" parent="."] +material = ExtResource( 4 ) +margin_top = 152.0 +margin_right = 256.0 +margin_bottom = 175.0 +theme = ExtResource( 3 ) +text = "The only way to improve is to learn +from mistakes" +align = 1 + +[node name="3DText" parent="." instance=ExtResource( 2 )] +anim = "game over" + +[connection signal="button_down" from="Panel/Retry" to="." method="_on_Retry_button_down"] +[connection signal="button_down" from="Panel/Retry" to="3DText" method="play_confirm_sound"] +[connection signal="focus_entered" from="Panel/Retry" to="MenuSounds" method="play_select_sound"] +[connection signal="button_down" from="Panel/Exit" to="." method="_on_Exit_button_down"] +[connection signal="button_down" from="Panel/Exit" to="3DText" method="play_confirm_sound"] +[connection signal="focus_entered" from="Panel/Exit" to="MenuSounds" method="play_select_sound"] diff --git a/objects/hud/3d_text.gd b/objects/hud/3d_text.gd index 3dbe314..dda4a03 100644 --- a/objects/hud/3d_text.gd +++ b/objects/hud/3d_text.gd @@ -26,3 +26,7 @@ func _set_material(value: Material) -> void: if not is_instance_valid(text_mesh): yield(self, "ready") text_mesh.mesh.material = text_material + + +func play_confirm_sound(): + pass # Replace with function body. diff --git a/objects/hud/3d_text.tscn b/objects/hud/3d_text.tscn index efdf9ad..de37d03 100644 --- a/objects/hud/3d_text.tscn +++ b/objects/hud/3d_text.tscn @@ -5,17 +5,17 @@ [ext_resource path="res://ui/Kozuka Mincho Std H.otf" type="DynamicFontData" id=3] [ext_resource path="res://ui/Boba Date.otf" type="DynamicFontData" id=4] -[sub_resource type="SpatialMaterial" id=16] -albedo_color = Color( 0.105882, 0.34902, 0.509804, 1 ) -metallic = 0.46 +[sub_resource type="SpatialMaterial" id=9] +albedo_color = Color( 0.901961, 0.133333, 0.133333, 1 ) +metallic = 0.35 [sub_resource type="DynamicFont" id=19] font_data = ExtResource( 1 ) [sub_resource type="TextMesh" id=2] resource_local_to_scene = true -material = SubResource( 16 ) -text = "WELC0ME T0 BUG W0RLD" +material = SubResource( 9 ) +text = "TEXT" font = SubResource( 19 ) pixel_size = 0.05 depth = 0.1 @@ -115,6 +115,10 @@ tracks/0/keys = { "values": [ Vector3( 0, 1, -100 ), Vector3( 0, 1, 0 ) ] } +[sub_resource type="SpatialMaterial" id=16] +albedo_color = Color( 0.105882, 0.34902, 0.509804, 1 ) +metallic = 0.46 + [sub_resource type="Animation" id=17] resource_name = "bug world" loop = true @@ -179,10 +183,6 @@ tracks/4/keys = { "values": [ ExtResource( 4 ) ] } -[sub_resource type="SpatialMaterial" id=9] -albedo_color = Color( 0.901961, 0.133333, 0.133333, 1 ) -metallic = 0.35 - [sub_resource type="Animation" id=18] resource_name = "fucker" length = 2.0 @@ -262,6 +262,7 @@ tracks/5/keys = { [sub_resource type="Animation" id=10] resource_name = "game over" +length = 2.0 step = 0.025 tracks/0/type = "value" tracks/0/path = NodePath("TextMesh:translation") @@ -270,10 +271,10 @@ tracks/0/loop_wrap = true tracks/0/imported = false tracks/0/enabled = true tracks/0/keys = { -"times": PoolRealArray( 0, 1 ), +"times": PoolRealArray( 0, 2 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, -"values": [ Vector3( 0, -3, 0 ), Vector3( 0, 1, 0 ) ] +"values": [ Vector3( 0, -3, 0 ), Vector3( 0, 1.8, 0 ) ] } tracks/1/type = "value" tracks/1/path = NodePath("TextMesh:scale") @@ -282,7 +283,7 @@ tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1 ), +"times": PoolRealArray( 0, 2 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, "values": [ Vector3( 0, 0, 0 ), Vector3( 1, 1, 1 ) ] @@ -294,7 +295,7 @@ tracks/2/loop_wrap = true tracks/2/imported = false tracks/2/enabled = true tracks/2/keys = { -"times": PoolRealArray( 0, 1 ), +"times": PoolRealArray( 0, 2 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, "values": [ Vector3( 0, 180, 0 ), Vector3( 0, 0, 0 ) ] @@ -321,7 +322,7 @@ tracks/4/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 1, -"values": [ "GAME OVER!" ] +"values": [ "GAME OVER" ] } tracks/5/type = "value" tracks/5/path = NodePath("TextMesh:mesh:font:font_data") @@ -567,7 +568,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 script = ExtResource( 2 ) text = "TEXT" -text_material = SubResource( 16 ) +text_material = SubResource( 9 ) [node name="Viewport" type="Viewport" parent="."] size = Vector2( 256, 192 )