Skip to content

Commit

Permalink
end screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Avnzx committed Jul 24, 2022
1 parent 95e9d3a commit 9ddbcbd
Show file tree
Hide file tree
Showing 22 changed files with 325 additions and 54 deletions.
Binary file added assets/fonts/arrow_die.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions assets/fonts/arrow_die.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/arrow_die.png-4edb9a2669c012716aee7255b9752aa2.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/fonts/arrow_die.png"
dest_files=[ "res://.import/arrow_die.png-4edb9a2669c012716aee7255b9752aa2.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added assets/fonts/arrow_win.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions assets/fonts/arrow_win.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/arrow_win.png-a8ef17ca539f94d891e777b3497ebbb2.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/fonts/arrow_win.png"
dest_files=[ "res://.import/arrow_win.png-a8ef17ca539f94d891e777b3497ebbb2.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added assets/fonts/pit_die.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions assets/fonts/pit_die.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/pit_die.png-aa919bdc70e689e57e735e9d84fe3a29.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/fonts/pit_die.png"
dest_files=[ "res://.import/pit_die.png-aa919bdc70e689e57e735e9d84fe3a29.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added assets/fonts/wumpus_death.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions assets/fonts/wumpus_death.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/wumpus_death.png-047bbf36d664372008c6947748f62fc7.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/fonts/wumpus_death.png"
dest_files=[ "res://.import/wumpus_death.png-047bbf36d664372008c6947748f62fc7.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
4 changes: 4 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,28 @@ key_forward={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
key_backward={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
key_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":2,"axis_value":-1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
key_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":2,"axis_value":1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
ui_zoom_in={
Expand Down
3 changes: 0 additions & 3 deletions scenes/End.tscn

This file was deleted.

Empty file added scenes/end/End.cs
Empty file.
64 changes: 64 additions & 0 deletions scenes/end/End.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[gd_scene load_steps=7 format=2]

[ext_resource path="res://assets/sky_seamless_texture_5904.jpg" type="Texture" id=1]
[ext_resource path="res://scripts/UI/Quit.cs" type="Script" id=2]
[ext_resource path="res://scripts/UI/TitleScreen.cs" type="Script" id=3]
[ext_resource path="res://assets/fonts/arrow_die.png" type="Texture" id=4]
[ext_resource path="res://scripts/UI/ReasonForEnd.cs" type="Script" id=5]

[sub_resource type="ShaderMaterial" id=1]

[node name="EndLayer" type="CanvasLayer"]

[node name="TextureRect" type="TextureRect" parent="."]
material = SubResource( 1 )
anchor_right = 1.0
anchor_bottom = 1.0
texture = ExtResource( 1 )
expand = true

[node name="ReasonForEnd" type="TextureRect" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -868.0
margin_top = -808.0
margin_right = 937.0
margin_bottom = 397.0
texture = ExtResource( 4 )
expand = true
stretch_mode = 1
script = ExtResource( 5 )

[node name="HBoxContainer" type="HBoxContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -200.0
margin_top = -50.0
margin_right = 200.0
margin_bottom = 50.0

[node name="Button" type="Button" parent="HBoxContainer"]
margin_right = 130.0
margin_bottom = 100.0
size_flags_horizontal = 3
text = "Quit"
script = ExtResource( 2 )

[node name="Button2" type="Button" parent="HBoxContainer"]
margin_left = 134.0
margin_right = 265.0
margin_bottom = 100.0
size_flags_horizontal = 3
text = "Title Screen"
script = ExtResource( 3 )

[node name="Button3" type="Button" parent="HBoxContainer"]
margin_left = 269.0
margin_right = 400.0
margin_bottom = 100.0
size_flags_horizontal = 3
text = "New Game"
Empty file added scenes/menus/MainMenu.cs
Empty file.
74 changes: 36 additions & 38 deletions scenes/menus/MainMenu.tscn
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]

[sub_resource type="SpatialMaterial" id=1]
flags_vertex_lighting = true
[ext_resource path="res://assets/sky_seamless_texture_5904.jpg" type="Texture" id=1]
[ext_resource path="res://scripts/UI/Quit.cs" type="Script" id=2]

[sub_resource type="SpatialMaterial" id=2]
flags_disable_ambient_light = true
albedo_color = Color( 0.686275, 0.654902, 0.717647, 1 )
roughness = 0.62
clearcoat_enabled = true
clearcoat = 0.83
clearcoat_gloss = 0.67
[sub_resource type="ShaderMaterial" id=1]

[node name="Spatial" type="Spatial"]
[node name="CanvasLayer" type="CanvasLayer"]

[node name="Camera" type="Camera" parent="."]
transform = Transform( 0.866025, 0, -0.5, 0, 1, 0, 0.5, 0, 0.866025, -2.29011, 0.96429, -0.495452 )

[node name="CSGBox" type="CSGBox" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 )
width = 7.454
height = 1.593
depth = 5.858
[node name="TextureRect" type="TextureRect" parent="."]
material = SubResource( 1 )

[node name="CSGBox" type="CSGBox" parent="CSGBox"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0460715, 1.58279, -2.70092 )
width = 7.454
height = 5.15782
depth = 0.023
material = SubResource( 2 )

[node name="CSGBox" type="CSGBox" parent="CSGBox/CSGBox"]
transform = Transform( 0.0304862, 0, -0.999535, 0, 1, 0, 0.999535, 0, 0.0304862, 2.61414, -0.10704, 2.91418 )
width = 7.454
height = 4.79101
depth = 0.023

[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( 0.5, 0.224144, -0.836516, 0, 0.965926, 0.258819, 0.866025, -0.12941, 0.482963, -1, 4, 6 )

[node name="Viewport" type="Viewport" parent="."]
size = Vector2( 1920, 1080 )
anchor_right = 1.0
anchor_bottom = 1.0
rect_clip_content = true
texture = ExtResource( 1 )
expand = true
stretch_mode = 1

[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -38.0
margin_top = -72.0
margin_right = 40.0
margin_bottom = 77.0

[node name="Button" type="Button" parent="VBoxContainer"]
margin_right = 82.0
margin_bottom = 72.0
size_flags_vertical = 3
text = "New Game"

[node name="Button2" type="Button" parent="VBoxContainer"]
margin_top = 76.0
margin_right = 82.0
margin_bottom = 149.0
size_flags_vertical = 3
text = "Quit"
script = ExtResource( 2 )
8 changes: 8 additions & 0 deletions scenes/overlays/CustButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,26 @@ public override void _Ready(){
whatami = ShooterButtonAction.Clear;
}

this.AddUserSignal("StateChanged");
this.Connect("StateChanged", GetNode("/root/GameState"), "HandleStateChanged");


AddUserSignal("ShooterButtonTriggered");
this.Connect("ShooterButtonTriggered", GetParent().GetParent<Shooter>(), "HandleButtonSignal");

}

public void ButtonPressed() {
EmitSignal("StateChanged");
EmitSignal("ShooterButtonTriggered", new Godot.Collections.Array{whatami});
}

public enum ShooterButtonAction {Shoot, Clear}


[Signal]
public delegate void StateChanged();

[Signal]
public delegate void ShooterButtonTriggered(ShooterButtonAction actn);
}
11 changes: 8 additions & 3 deletions scripts/SceneManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,17 @@ public void RemoveLatestScene(){
}

public void GotoEndScene(EndReason endreason) {
CurrentScene?.QueueFree();
GD.Print("going to new end scene...", endreason);
GetNode<GameState>("/root/GameState").endReason = endreason;
GD.Print("going to new end scene... ", endreason);
DeferredGotoScene("res://scenes/end/End.tscn");

}

public void Quit() {
System.Environment.Exit(0);
}

public enum EndReason {Wumpus, Pit, Win}
public enum EndReason {Wumpus, Pit, Win, Arrows}

// public void gotoscene("res::pathToScene", string array scenes to destroy, bool destroy all scenes)

Expand Down
10 changes: 10 additions & 0 deletions scripts/UI/Quit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class Quit : Godot.Button {

public override void _Ready(){
this.Connect("pressed", this, "DoQuit");
}

public void DoQuit() {
GetNode<SceneManager>("/root/SceneManager").Quit();
}
}
Loading

0 comments on commit 9ddbcbd

Please sign in to comment.