Commit ab265aa1 authored by Emery Tanghanwaye's avatar Emery Tanghanwaye
Browse files

Merge branch 'final'

parents 7b666da6 353918a8
using Godot;
using System;
public class Background : AnimatedSprite
{
private Camera2D Cam;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
Cam = GetNode<Camera2D>("../../Camera2D");
}
public override void _PhysicsProcess(float delta)
{
Vector2 Pos = new Vector2(Cam.Offset.x - 640, Position.y);
SetPosition(Pos);
}
// // Called every frame. 'delta' is the elapsed time since the previous frame.
// public override void _Process(float delta)
// {
//
// }
}
......@@ -5,7 +5,7 @@ using System.Collections.Generic;
public class Game : Node2D
{
// initial amount of money player has
private float _Money = 990f;
private float _Money = 0f;
// the amount of money player earns per second
private float _ProfitRate = 1f;
......@@ -16,6 +16,7 @@ public class Game : Node2D
// sprite for the game background
private AnimatedSprite Background;
private Sprite FailScreen;
// Labels for different text labels in the game
private Label MoneyLabel;
......@@ -245,12 +246,12 @@ public class Game : Node2D
ProfitRate += 5000;
if (BadPoints >= 20)
{
Background.Frame = 5;
Background.Frame = 4;
StageLabel.Text = "Stage: Glacier";
}
else
{
Background.Frame = 4;
Background.Frame = 5;
StageLabel.Text = "Stage: Dam";
}
}
......@@ -264,7 +265,7 @@ public class Game : Node2D
}
else
{
Background.Frame = 5;
Background.Frame = 6;
ButtGroup.EnableNextButton();
CreateFifthStageButtons();
StageLabel.Text = "Stage 5: Philanthropy";
......@@ -276,23 +277,23 @@ public class Game : Node2D
private void EndGameBad()
{
// TODO
FailScreen.Visible = true;
}
public override void _Ready()
{
// pulls in background object
Background = GetNode<AnimatedSprite>("GUI/CanvasLayer/Background");
Background = GetNode<AnimatedSprite>("ScrollCamera/Camera2D/Background");
FailScreen = GetNode<Sprite>("GUI/CanvasLayer/FailScreen");
// Pulls in our labels
MoneyLabel = GetNode<Label>("GUI/CanvasLayer/MoneyLabel");
ProfitLabel = GetNode<Label>("GUI/CanvasLayer/ProfitLabel");
StageLabel = GetNode<Label>("GUI/CanvasLayer/StageLabel");
GoalLabel = GetNode<Label>("GUI/CanvasLayer/GoalLabel");
TargetRateLabel = GetNode<Label>("GUI/CanvasLayer/TargetRateLabel");
// Pull in GUI reference
ButtonHolder = GetNode<Control>("GUI/CanvasLayer/ButtonHolder");
ButtonHolder = GetNode<Control>("GUI/ButtonHolder");
// Get Button Group Reference
ButtGroup = GetNode<ButtonGroup>("ScrollCamera/CanvasLayer/ButtonGroup");
......
[gd_scene load_steps=10 format=2]
[gd_scene load_steps=14 format=2]
[ext_resource path="res://Game.cs" type="Script" id=1]
[ext_resource path="res://ButtonGroup.cs" type="Script" id=2]
[ext_resource path="res://assets/level1.jpeg" type="Texture" id=3]
[ext_resource path="res://assets/level2.jpeg" type="Texture" id=4]
[ext_resource path="res://assets/level3bad.jpeg" type="Texture" id=5]
[ext_resource path="res://assets/level3good.jpeg" type="Texture" id=6]
[ext_resource path="res://assets/level4bad.jpg" type="Texture" id=7]
[ext_resource path="res://assets/level4good.jpeg" type="Texture" id=8]
[ext_resource path="res://assets/level1.jpeg" type="Texture" id=2]
[ext_resource path="res://assets/level2.jpeg" type="Texture" id=3]
[ext_resource path="res://assets/level3bad.jpeg" type="Texture" id=4]
[ext_resource path="res://assets/level3good.jpeg" type="Texture" id=5]
[ext_resource path="res://assets/level4bad.jpg" type="Texture" id=6]
[ext_resource path="res://assets/level4good.jpeg" type="Texture" id=7]
[ext_resource path="res://assets/level5good.jpeg" type="Texture" id=8]
[ext_resource path="res://Background.cs" type="Script" id=9]
[ext_resource path="res://ButtonGroup.cs" type="Script" id=10]
[ext_resource path="res://assets/stage5bad.jpeg" type="Texture" id=11]
[ext_resource path="res://Music/1_Aerobatics_in_Slow_Motion.ogg" type="AudioStream" id=12]
[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ ExtResource( 3 ), ExtResource( 4 ), ExtResource( 5 ), ExtResource( 6 ), ExtResource( 7 ), ExtResource( 8 ) ],
"frames": [ ExtResource( 2 ), ExtResource( 3 ), ExtResource( 4 ), ExtResource( 5 ), ExtResource( 6 ), ExtResource( 7 ), ExtResource( 8 ) ],
"loop": true,
"name": "default",
"speed": 5.0
......@@ -30,6 +34,13 @@ margin_bottom = 700.0
offset = Vector2( 580, -300 )
current = true
[node name="Background" type="AnimatedSprite" parent="ScrollCamera/Camera2D"]
position = Vector2( -60, -660 )
scale = Vector2( 0.6, 0.6 )
frames = SubResource( 1 )
centered = false
script = ExtResource( 9 )
[node name="CanvasLayer" type="CanvasLayer" parent="ScrollCamera"]
[node name="ButtonGroup" type="Control" parent="ScrollCamera/CanvasLayer"]
......@@ -37,7 +48,7 @@ margin_left = 60.0
margin_top = 660.0
margin_right = 100.0
margin_bottom = 700.0
script = ExtResource( 2 )
script = ExtResource( 10 )
[node name="Tween" type="Tween" parent="ScrollCamera/CanvasLayer/ButtonGroup"]
......@@ -45,11 +56,6 @@ script = ExtResource( 2 )
[node name="CanvasLayer" type="CanvasLayer" parent="GUI"]
[node name="Background" type="AnimatedSprite" parent="GUI/CanvasLayer"]
scale = Vector2( 0.6, 0.6 )
frames = SubResource( 1 )
centered = false
[node name="ProfitLabel" type="Label" parent="GUI/CanvasLayer"]
margin_left = 60.0
margin_top = 30.0
......@@ -78,14 +84,24 @@ margin_right = 60.0
margin_bottom = 89.0
text = "Next Goal: $0"
[node name="ColorRect" type="ColorRect" parent="GUI/CanvasLayer"]
[node name="FailScreen" type="Sprite" parent="GUI/CanvasLayer"]
visible = false
position = Vector2( 626.394, 346.165 )
scale = Vector2( 0.6, 0.6 )
texture = ExtResource( 11 )
[node name="ButtonHolder" type="Control" parent="GUI"]
margin_right = 40.0
margin_bottom = 40.0
[node name="ColorRect" type="ColorRect" parent="GUI/ButtonHolder"]
modulate = Color( 1, 1, 1, 0.803922 )
margin_left = -91.0
margin_top = 115.0
margin_right = 1407.0
margin_right = 10567.0
margin_bottom = 692.0
color = Color( 0.25098, 0.25098, 0.25098, 1 )
[node name="ButtonHolder" type="Control" parent="GUI/CanvasLayer"]
margin_right = 40.0
margin_bottom = 40.0
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 12 )
autoplay = true
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/1_Aerobatics_in_Slow_Motion.ogg-6d5e4ef75ba48c9b88c5bc27ced8cc64.oggstr"
[deps]
source_file="res://Music/1_Aerobatics_in_Slow_Motion.ogg"
dest_files=[ "res://.import/1_Aerobatics_in_Slow_Motion.ogg-6d5e4ef75ba48c9b88c5bc27ced8cc64.oggstr" ]
[params]
loop=true
loop_offset=0
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/2_Peaceful_Orbits.ogg-53e693d5d9a788742170cd729784bb0f.oggstr"
[deps]
source_file="res://Music/2_Peaceful_Orbits.ogg"
dest_files=[ "res://.import/2_Peaceful_Orbits.ogg-53e693d5d9a788742170cd729784bb0f.oggstr" ]
[params]
loop=true
loop_offset=0
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/3_Technopop_7d.ogg-780ae49f790b52dea957e1127a379fc2.oggstr"
[deps]
source_file="res://Music/3_Technopop_7d.ogg"
dest_files=[ "res://.import/3_Technopop_7d.ogg-780ae49f790b52dea957e1127a379fc2.oggstr" ]
[params]
loop=true
loop_offset=0
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/4_Following_Spirits.ogg-d3431f8ed2dc39f5e25e407a711fe814.oggstr"
[deps]
source_file="res://Music/4_Following_Spirits.ogg"
dest_files=[ "res://.import/4_Following_Spirits.ogg-d3431f8ed2dc39f5e25e407a711fe814.oggstr" ]
[params]
loop=true
loop_offset=0
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/5_Strolling_in_Bliss.ogg-e390a4dc3ae91f656322773e309ba1fb.oggstr"
[deps]
source_file="res://Music/5_Strolling_in_Bliss.ogg"
dest_files=[ "res://.import/5_Strolling_in_Bliss.ogg-e390a4dc3ae91f656322773e309ba1fb.oggstr" ]
[params]
loop=true
loop_offset=0
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/6_Trolls_Feast_Tonight.ogg-019933026efe91d99a885989486f4f88.oggstr"
[deps]
source_file="res://Music/6_Trolls_Feast_Tonight.ogg"
dest_files=[ "res://.import/6_Trolls_Feast_Tonight.ogg-019933026efe91d99a885989486f4f88.oggstr" ]
[params]
loop=true
loop_offset=0
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/7_Serene_Acoustic_Vibes.ogg-38331ca85767ee525e3ecbe137ed8fad.oggstr"
[deps]
source_file="res://Music/7_Serene_Acoustic_Vibes.ogg"
dest_files=[ "res://.import/7_Serene_Acoustic_Vibes.ogg-38331ca85767ee525e3ecbe137ed8fad.oggstr" ]
[params]
loop=true
loop_offset=0
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/8_Fields_of_the_Lost.ogg-65eef7aea6874bf9c7db4cde5a48c2cc.oggstr"
[deps]
source_file="res://Music/8_Fields_of_the_Lost.ogg"
dest_files=[ "res://.import/8_Fields_of_the_Lost.ogg-65eef7aea6874bf9c7db4cde5a48c2cc.oggstr" ]
[params]
loop=true
loop_offset=0
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/stage5bad.jpeg-633e5eff8f4e2235fdfbdddd2e0dcfb4.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/stage5bad.jpeg"
dest_files=[ "res://.import/stage5bad.jpeg-633e5eff8f4e2235fdfbdddd2e0dcfb4.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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
......@@ -15,7 +15,7 @@ _global_script_class_icons={
[application]
config/name="WaterGame"
config/name="Eco Capitalist"
run/main_scene="res://Game.tscn"
config/icon="res://icon.png"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment