From f397a5274920421a3b37374ea5876476937c897d Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Tue, 3 Nov 2020 14:55:20 -0600 Subject: [PATCH] Introduce save feature Added a save feature (still a huge work in progress!) --- Game Scenes/Game.tscn | 16 ++++++++++++++-- Images and Anims/In Game/.DS_Store | Bin 6148 -> 6148 bytes Objects/Coin.gd | 1 - Objects/Coin.tscn | 1 - Scripts/CoinLabel.gd | 5 +++++ export_presets.cfg | 2 +- 6 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 Scripts/CoinLabel.gd diff --git a/Game Scenes/Game.tscn b/Game Scenes/Game.tscn index 3f8adfe..b095a3f 100644 --- a/Game Scenes/Game.tscn +++ b/Game Scenes/Game.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://Objects/Rocket.tscn" type="PackedScene" id=1] [ext_resource path="res://Scripts/Rocket.gd" type="Script" id=2] [ext_resource path="res://Images and Anims/In Game/background.png" type="Texture" id=3] [ext_resource path="res://Scripts/Game.gd" type="Script" id=4] [ext_resource path="res://Scripts/Score.gd" type="Script" id=5] +[ext_resource path="res://Scripts/CoinLabel.gd" type="Script" id=6] [node name="Game" type="Node2D"] script = ExtResource( 4 ) @@ -19,7 +20,17 @@ offset = Vector2( 0, -220 ) current = true smoothing_enabled = true -[node name="Label" type="Label" parent="Rocket"] +[node name="Coins" type="Label" parent="Rocket/Camera2D"] +margin_left = 166.0 +margin_top = -254.0 +margin_right = 250.0 +margin_bottom = -239.0 +script = ExtResource( 6 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Score" type="Label" parent="Rocket"] margin_left = 13.0 margin_top = 9.0 margin_right = 44.0 @@ -35,6 +46,7 @@ __meta__ = { motion_scale = Vector2( 0.01, 0.01 ) [node name="Background" type="Sprite" parent="ParallaxBackground/ParallaxLayer"] +visible = false position = Vector2( 89.4544, -100.794 ) scale = Vector2( 5, 5 ) texture = ExtResource( 3 ) diff --git a/Images and Anims/In Game/.DS_Store b/Images and Anims/In Game/.DS_Store index 4aa90a3488daddadeac15d91843556dbfffbc4fc..b1468d6a84f5890fe79d571e93784c4a429ccc73 100644 GIT binary patch literal 6148 zcmeHKOHRWu5PfdDC0f2reh_pfdNGx*zZo!&6AU5o{61=f3 z6gMBbLI`;z`z6kN>^IIh0iaG6gCn2~pvflKXt660c`hv{H9OKFD(z#61a}zV5Dz(R zKj0bg4E!|)mQAY~IlP-wu0nlP}^Rz-L0~%nuV-IwKHpJat2bnCc1VNMy@?&^tYDv ze~MN=&seYF6p!R5X3QC*CYa<|a^_cH5s!|#{bXz^t?Imzn*yzI5=AzLEaK_=%k$fD zndV?c&4=4e=fBlMV0wG9@>tFOWbhn*WCZZ^1bBbcJC+qs@ceT91bKKs|n9+k>}tG~=M6y-UdyL~U|=z{m>T30iZZ4|W2)>ghBD?H53F8jF*Rt+ zp>$;Wv5}SiLs2?9#{;bn6&m!tXTUSyGEg_SZ8`r>%m4pfBY)=^@C^Jb22>;JM*OMa zp<66+)&^`>Y$BqU8q_B2>~X9wlV{D*+1!FQg4UuED6CISGu delta 94 zcmZoMXfc=|#>B`mu~2NHo}wrV0|Nsi1A_nqLq0<>Lne^S%SoSDxSWw?@&?w$n?*T< nST;7eF>Pk&;O7A9+APTNoq009h$T=1SR)gZX4xDevW6J|$jK6} diff --git a/Objects/Coin.gd b/Objects/Coin.gd index 15e7c8a..6a4bc17 100644 --- a/Objects/Coin.gd +++ b/Objects/Coin.gd @@ -1,7 +1,6 @@ extends Area2D func _on_Coin_body_entered(body): - print (body.name) if body.name == "Rocket": var numOfCoins = get_parent().get("numOfCoins") numOfCoins += 1 diff --git a/Objects/Coin.tscn b/Objects/Coin.tscn index 04f05bc..d756bf8 100644 --- a/Objects/Coin.tscn +++ b/Objects/Coin.tscn @@ -49,6 +49,5 @@ shape = SubResource( 1 ) scale = Vector2( 2, 2 ) frames = SubResource( 7 ) animation = "Spin" -frame = 2 playing = true [connection signal="body_entered" from="." to="." method="_on_Coin_body_entered"] diff --git a/Scripts/CoinLabel.gd b/Scripts/CoinLabel.gd new file mode 100644 index 0000000..582dab5 --- /dev/null +++ b/Scripts/CoinLabel.gd @@ -0,0 +1,5 @@ +extends Label + +func _process(delta): + var coins = str(get_parent().get_parent().get_parent().get("numOfCoins")) + text = coins diff --git a/export_presets.cfg b/export_presets.cfg index cded969..d4ab7e3 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -7,7 +7,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="Builds/macOS/spacescape-macos.dmg" +export_path="../spacescape.dmg" patch_list=PoolStringArray( ) script_export_mode=1 script_encryption_key=""