From b718c0f31b6d2162522da69521cf100f2c62ddfe Mon Sep 17 00:00:00 2001 From: Martin Araneda Date: Sun, 28 Aug 2022 15:02:28 -0400 Subject: [PATCH 1/3] no changes --- godot/Main.tscn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/godot/Main.tscn b/godot/Main.tscn index 5babece..e3fc9ab 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://Main.gdns" type="Script" id=1] -[ext_resource path="res://levels/Prototype.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/PrototypeEnemies.tscn" type="PackedScene" id=2] [ext_resource path="res://GUI/GameOver.tscn" type="PackedScene" id=3] [node name="Main" type="Node"] From 7e57e782051045c435835d3cfa9f7da24e9b57e7 Mon Sep 17 00:00:00 2001 From: Martin Araneda Date: Sun, 28 Aug 2022 15:04:50 -0400 Subject: [PATCH 2/3] Revert "no changes" This reverts commit b718c0f31b6d2162522da69521cf100f2c62ddfe. --- godot/Main.tscn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/godot/Main.tscn b/godot/Main.tscn index e3fc9ab..5babece 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://Main.gdns" type="Script" id=1] -[ext_resource path="res://levels/PrototypeEnemies.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/Prototype.tscn" type="PackedScene" id=2] [ext_resource path="res://GUI/GameOver.tscn" type="PackedScene" id=3] [node name="Main" type="Node"] From 0e4bad4823dd71b9e3d3f701358554a8322f6369 Mon Sep 17 00:00:00 2001 From: Martin Araneda Date: Sun, 28 Aug 2022 20:15:40 -0400 Subject: [PATCH 3/3] R prototype lvl made. Coins and coinHUD added --- godot/Main.tscn | 2 +- godot/levels/Prototype.tscn | 1 - godot/levels/PrototypeR.tmx | 19 ++++++++ godot/levels/PrototypeR.tmx.import | 24 ++++++++++ godot/levels/PrototypeR.tscn | 72 ++++++++++++++++++++++++++++ src/gui/game_over/GameOverScreen.cpp | 5 +- 6 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 godot/levels/PrototypeR.tmx create mode 100644 godot/levels/PrototypeR.tmx.import create mode 100644 godot/levels/PrototypeR.tscn diff --git a/godot/Main.tscn b/godot/Main.tscn index 5babece..d63b2cb 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://Main.gdns" type="Script" id=1] -[ext_resource path="res://levels/Prototype.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/PrototypeR.tscn" type="PackedScene" id=2] [ext_resource path="res://GUI/GameOver.tscn" type="PackedScene" id=3] [node name="Main" type="Node"] diff --git a/godot/levels/Prototype.tscn b/godot/levels/Prototype.tscn index b71e0c7..320b814 100644 --- a/godot/levels/Prototype.tscn +++ b/godot/levels/Prototype.tscn @@ -14,7 +14,6 @@ collision_layer = 5 [node name="Camera2D" type="Camera2D" parent="Player"] -current = true limit_left = 0 limit_top = 0 limit_right = 512 diff --git a/godot/levels/PrototypeR.tmx b/godot/levels/PrototypeR.tmx new file mode 100644 index 0000000..57d9e74 --- /dev/null +++ b/godot/levels/PrototypeR.tmx @@ -0,0 +1,19 @@ + + + + + + KLUv/WAAO9UGAOQDABIAAAATFAAnEiYoEjo8YgAAADs6dQA6iwAAAIwAOnUAihIoADd/YwAAAGQAAAB4AAAAdiY3ADqLYwAAgAA8oBCVNdsBwAKTQCJcY8XxUYoarT8gQjyeu5O6nkqpOlT1gMJhyWO43xyk5jp+D3SGOxcoT52U4vScQx63fcb98i+k3jK5QUu8pNUR8O+i4l7VPW51R5d4k1T3FuabG4vErcrOI+U6fRflI6vfRsa41pUIv1HPe0OudqI1qDNHH2bcTSH3r27pd6Tac6lM+3bwXaj+q2cxvogB + + + + + KLUv/WAAOz0FAIQCADEAAAAyMwACAAAAAwQAAhYAAAAXGAB6AAAAe3wAF4ZfAHuIAIZeiCygMLF1UIIUiARiZAelj/9XjXZV/ipp0q1TfoI4FDJcav6xkgcm3cqld/XLYVzNgPGrRkX6pwiG831dQsKVhvGrM0E5nOTUdZpyl96SqGcYDzh1mVBuKT0+fmorpXmjgBlElduJp59uitTebrC/onYW//xER7myT2JL+hkD + + + + + KLUv/WAAO70CAKgAdAB0AIiINzeIN0YjWjcjNyNuNwAaoJD2AWBDhVoO4YKf+iiKEtrHJVQSqc4GzhDlVlFe0Tb1bDJ629TRhBsftwpQtCpKtEu19HH9uSSqrEzywUAhHQ== + + + diff --git a/godot/levels/PrototypeR.tmx.import b/godot/levels/PrototypeR.tmx.import new file mode 100644 index 0000000..17122e4 --- /dev/null +++ b/godot/levels/PrototypeR.tmx.import @@ -0,0 +1,24 @@ +[remap] + +importer="vnen.tiled_importer" +type="PackedScene" +path="res://.import/PrototypeR.tmx-dfb7d18f520c5c44182a13443fe1b69c.scn" + +[deps] + +source_file="res://levels/PrototypeR.tmx" +dest_files=[ "res://.import/PrototypeR.tmx-dfb7d18f520c5c44182a13443fe1b69c.scn" ] + +[params] + +custom_properties=true +tile_metadata=false +uv_clip=true +y_sort=false +image_flags=0 +collision_layer=2 +collision_mask=0 +embed_internal_images=false +save_tiled_properties=false +add_background=true +post_import_script="" diff --git a/godot/levels/PrototypeR.tscn b/godot/levels/PrototypeR.tscn new file mode 100644 index 0000000..299779a --- /dev/null +++ b/godot/levels/PrototypeR.tscn @@ -0,0 +1,72 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://CameraLimit.gdns" type="Script" id=1] +[ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/PrototypeR.tmx" type="PackedScene" id=3] +[ext_resource path="res://assets/backgrounds/hills.png" type="Texture" id=4] +[ext_resource path="res://hud/CoinHUD.tscn" type="PackedScene" id=5] +[ext_resource path="res://collectables/coin/Coin.tscn" type="PackedScene" id=6] + +[node name="Prototype" type="Node2D"] + +[node name="Player" parent="." instance=ExtResource( 2 )] +collision_layer = 5 + +[node name="Camera2D" type="Camera2D" parent="Player"] +current = true +limit_left = 0 +limit_top = 0 +limit_right = 512 +limit_bottom = 288 +drag_margin_h_enabled = true +drag_margin_v_enabled = true +__meta__ = { +"_edit_bone_": true +} + +[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="Player/Camera2D"] +rect = Rect2( 0, 0, 24, 24 ) + +[node name="ParallaxBackground" type="ParallaxBackground" parent="."] + +[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] +motion_scale = Vector2( 0.2, 0.1 ) +motion_offset = Vector2( 0, -288 ) +motion_mirroring = Vector2( 528, 0 ) + +[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"] +texture = ExtResource( 4 ) +centered = false + +[node name="Map" type="Node2D" parent="."] + +[node name="PrototypeR" parent="Map" instance=ExtResource( 3 )] +script = ExtResource( 1 ) + +[node name="CoinHUD" parent="." instance=ExtResource( 5 )] + +[node name="Coins" type="Node" parent="."] + +[node name="Coin" parent="Coins" instance=ExtResource( 6 )] +position = Vector2( 270, 432 ) + +[node name="Coin2" parent="Coins" instance=ExtResource( 6 )] +position = Vector2( 846, 252 ) + +[node name="Coin3" parent="Coins" instance=ExtResource( 6 )] +position = Vector2( 1278, 342 ) + +[node name="Coin4" parent="Coins" instance=ExtResource( 6 )] +position = Vector2( 1278, 180 ) + +[node name="Coin5" parent="Coins" instance=ExtResource( 6 )] +position = Vector2( 522, 270 ) + +[node name="Coin6" parent="Coins" instance=ExtResource( 6 )] +position = Vector2( 990, 324 ) + +[node name="Coin7" parent="Coins" instance=ExtResource( 6 )] +position = Vector2( 468, 306 ) + +[node name="Coin8" parent="Coins" instance=ExtResource( 6 )] +position = Vector2( 576, 306 ) diff --git a/src/gui/game_over/GameOverScreen.cpp b/src/gui/game_over/GameOverScreen.cpp index fc35153..ca87875 100644 --- a/src/gui/game_over/GameOverScreen.cpp +++ b/src/gui/game_over/GameOverScreen.cpp @@ -36,9 +36,10 @@ void alai::GameOverScreen::_ready() void alai::GameOverScreen::_on_restart_button_pressed() { - if (_resource_loader->exists("res://levels/Prototype.tscn")) + /*_r*/ + if (_resource_loader->exists("res://levels/PrototypeR.tscn")) { - godot::Ref level_scene = _resource_loader->load("res://levels/Prototype.tscn"); + godot::Ref level_scene = _resource_loader->load("res://levels/PrototypeR.tscn"); auto level = level_scene->instance(); auto level_node = get_tree()->get_root()->get_node("Main")->find_node("Level");