Merge branch 'main' of https://github.com/MarcEricMartel/MAD
This commit is contained in:
commit
71e524876f
@ -18,7 +18,7 @@ public partial class the_end : Control
|
||||
private void Tick() {
|
||||
if (_tock == 0)
|
||||
_lbl.Set("visible", true);
|
||||
if (_tock == 4) {
|
||||
if (_tock == 3) {
|
||||
var scene = GD.Load<PackedScene>("res://menu/start_game_menu.tscn");
|
||||
var instance = scene.Instantiate();
|
||||
GetNode<Node>("/root/").AddChild(instance);
|
||||
|
@ -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
|
||||
|
@ -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 str)
|
||||
{
|
||||
|
||||
var scene = GD.Load<PackedScene>("res://endings/mad.tscn");
|
||||
var scene = GD.Load<PackedScene>(str);
|
||||
var instance = scene.Instantiate();
|
||||
GetNode<Node>("/root/").AddChild(instance);
|
||||
this.GetParent().QueueFree();
|
||||
|
Loading…
Reference in New Issue
Block a user