This commit is contained in:
MarcEricMartel 2023-06-11 17:32:21 -04:00
parent b1f0df2633
commit 3cd045dc6f
2 changed files with 277 additions and 278 deletions

View File

@ -1,10 +1,10 @@
[gd_scene load_steps=10 format=3 uid="uid://4tym1auav4yv"]
[ext_resource type="Script" path="res://menu/start_game_menu.cs" id="1_0k2xm"]
[ext_resource type="Texture2D" uid="uid://bd7j1ug5gs26w" path="res://images/mushroom_cloud001.webp" id="2_aky60"]
[ext_resource type="AudioStream" uid="uid://co52ygvp3wcra" path="res://music/I Feel Grunge (Slow).wav" id="2_yw57x"]
[ext_resource type="AudioStream" uid="uid://ds7ec1n3pytnr" path="res://audio/btn.wav" id="4_fx2mk"]
[ext_resource type="AudioStream" uid="uid://cg78xtngxrjlg" path="res://audio/dot.wav" id="5_y8gc7"]
[ext_resource type="Texture2D" uid="uid://b44vs2lwgnh37" path="res://images/mushroom_cloud001.webp" id="2_aky60"]
[ext_resource type="AudioStream" uid="uid://ckg5eypyrhidg" path="res://music/I Feel Grunge (Slow).wav" id="2_yw57x"]
[ext_resource type="AudioStream" uid="uid://c8dcqkmytnyay" path="res://audio/btn.wav" id="4_fx2mk"]
[ext_resource type="AudioStream" uid="uid://dja6tipmq1m8l" path="res://audio/dot.wav" id="5_y8gc7"]
[sub_resource type="LabelSettings" id="LabelSettings_n38oc"]
font_size = 290

View File

@ -215,22 +215,21 @@ public partial class player : Camera3D
_wOut = true;
}
}
private void CheckGame()
{
bool gameover = false;
private void CheckGame() {
if (PR <= 0)
gameover = true;
End("res://endings/revolution.tscn");
else if (Nukes >= 100)
{
_btnEnd.Disabled = false;
_btnEnd.Pressed += () => { _sndBtn.Play(); Nuke(); };
_btnEnd.Pressed += () => { _sndBtn.Play(); End("res://endings/mad.tscn"); };
Chatter = "You can destroy your enemy, you have the nuclear capacity."
}
if (GameTime <= 0)
gameover = true;
if (gameover)
Chatter = "Game Over.";
if (GameTime < 0)
if (Nukes >= 100)
End("res://endings/coldwar.tscn");
else if (Nukes == 0)
End("res://endings/peace.tscn");
else End("res://endings/gotnuked.tscn");
}
public void BuildBuilding(int price, int pr, int nukes, int kashFlow = 0)
@ -316,10 +315,10 @@ public partial class player : Camera3D
}
}
public void Nuke()
public void End(string scene)
{
var scene = GD.Load<PackedScene>("res://endings/mad.tscn");
var scene = GD.Load<PackedScene>(scene);
var instance = scene.Instantiate();
GetNode<Node>("/root/").AddChild(instance);
this.GetParent().QueueFree();