From 2aaaf78e2022d28c339cae544d8f96e55878ef28 Mon Sep 17 00:00:00 2001 From: LifeHckr Date: Sat, 22 Feb 2025 14:00:46 -0800 Subject: [PATCH 1/5] Chest Room finished Moved song data into config object in StageProducer for persistant and progressable map Moved menu inputs into abstracted node for portability Added chest scene, currently gives relic selection --- Globals/FunkEngineNameSpace.cs | 26 +++++----- Globals/StageProducer.cs | 34 +++++++++++-- .../BattleDirector/scripts/BattleDirector.cs | 45 ++++++------------ scenes/BattleDirector/test_battle_scene.tscn | 4 +- scenes/ChestScene/ChestScene.cs | 40 ++++++++++++++++ scenes/ChestScene/ChestScene.tscn | 39 +++++++++++++++ scenes/ChestScene/assets/Chest.png | Bin 0 -> 1298 bytes scenes/ChestScene/assets/Chest.png.import | 34 +++++++++++++ scenes/Maps/scripts/Cartographer.cs | 6 +-- scenes/Puppets/scripts/PlayerPuppet.cs | 2 +- scenes/SceneTransitions/TitleScreen.tscn | 4 +- scenes/UI/scripts/MenuModule.cs | 23 +++++++++ scenes/UI/scripts/RewardSelect.cs | 16 +++++++ 13 files changed, 216 insertions(+), 57 deletions(-) create mode 100644 scenes/ChestScene/ChestScene.cs create mode 100644 scenes/ChestScene/ChestScene.tscn create mode 100644 scenes/ChestScene/assets/Chest.png create mode 100644 scenes/ChestScene/assets/Chest.png.import create mode 100644 scenes/UI/scripts/MenuModule.cs diff --git a/Globals/FunkEngineNameSpace.cs b/Globals/FunkEngineNameSpace.cs index f4626224..bafd8e1c 100644 --- a/Globals/FunkEngineNameSpace.cs +++ b/Globals/FunkEngineNameSpace.cs @@ -38,10 +38,10 @@ public enum Timing public struct BattleConfig { - public MapRooms RoomType { get; private set; } - public MapGrid.Room CurRoom { get; private set; } - public SongData CurSong { get; set; } + public Stages RoomType; + public MapGrid.Room BattleRoom; public int TodoEnemyAndChart; + public SongData CurSong; } public enum BattleEffectTrigger @@ -55,16 +55,11 @@ public enum BattleEffectTrigger public enum Stages { Title, - Battle, - Quit, - Map, -} - -public enum MapRooms -{ Battle, Chest, Boss, + Quit, + Map, } public class MapGrid @@ -87,7 +82,7 @@ public Room(int idx, int x, int y) Y = y; } - public void SetType(MapRooms type) + public void SetType(Stages type) { Type = type; } @@ -103,7 +98,7 @@ public void AddChild(int newIdx) public int[] Children { get; private set; } = Array.Empty(); public int X { get; private set; } public int Y { get; private set; } - public MapRooms Type { get; private set; } + public Stages Type { get; private set; } } public void InitMapGrid(int width, int height, int paths) @@ -114,6 +109,7 @@ public void InitMapGrid(int width, int height, int paths) int startX = (width / 2); _rooms = _rooms.Append(new Room(_curIdx, startX, 0)).ToArray(); + _rooms[0].SetType(Stages.Battle); _map[startX, 0] = _curIdx++; for (int i = 0; i < paths; i++) @@ -136,10 +132,10 @@ private void GeneratePath_r(int x, int y, int width, int height) _rooms = _rooms.Append(new Room(_curIdx, nextX, y + 1)).ToArray(); _map[nextX, y + 1] = _curIdx; _rooms[_map[x, y]].AddChild(_curIdx++); - _rooms[^1].SetType(MapRooms.Battle); + _rooms[^1].SetType(Stages.Battle); if (y > 0 && y % 3 == 0) { - _rooms[^1].SetType(MapRooms.Chest); + _rooms[^1].SetType(Stages.Chest); } } else @@ -171,7 +167,7 @@ private void CreateCommonChildren(int width, int height) private void AddBossRoom(int width, int height) { _rooms = _rooms.Append(new Room(_curIdx, width / 2, height)).ToArray(); - _rooms[_curIdx].SetType(MapRooms.Boss); + _rooms[_curIdx].SetType(Stages.Boss); for (int i = 0; i < width; i++) //Attach all last rooms to a boss room { if (_map[i, height - 1] != 0) diff --git a/Globals/StageProducer.cs b/Globals/StageProducer.cs index 2167a8d9..d0403ae5 100644 --- a/Globals/StageProducer.cs +++ b/Globals/StageProducer.cs @@ -36,13 +36,17 @@ public void StartGame() _isInitialized = true; } + public static void ChangeCurRoom(MapGrid.Room room) + { + CurRoom = room; + } + public void TransitionFromRoom(int nextRoomIdx) { - //CurRoom = Map.GetRooms()[nextRoomIdx]; - TransitionStage(Stages.Battle); + TransitionStage(Map.GetRooms()[nextRoomIdx].Type, nextRoomIdx); } - public void TransitionStage(Stages nextStage) + public void TransitionStage(Stages nextStage, int nextRoomIdx = -1) { GD.Print(GetTree().CurrentScene); switch (nextStage) @@ -52,9 +56,13 @@ public void TransitionStage(Stages nextStage) GetTree().ChangeSceneToFile("res://scenes/SceneTransitions/TitleScreen.tscn"); break; case Stages.Battle: - Config = new BattleConfig() { }; + Config = MakeConfig(nextStage, nextRoomIdx); GetTree().ChangeSceneToFile("res://scenes/BattleDirector/test_battle_scene.tscn"); break; + case Stages.Chest: + Config = MakeConfig(nextStage, nextRoomIdx); + GetTree().ChangeSceneToFile("res://scenes/ChestScene/ChestScene.tscn"); + break; case Stages.Map: GetTree().ChangeSceneToFile("res://scenes/Maps/cartographer.tscn"); if (!_isInitialized) @@ -73,4 +81,22 @@ public void TransitionStage(Stages nextStage) _curStage = nextStage; } + + private BattleConfig MakeConfig(Stages nextRoom, int nextRoomIdx) + { + BattleConfig result = new BattleConfig(); + result.BattleRoom = Map.GetRooms()[nextRoomIdx]; + result.RoomType = nextRoom; + if (nextRoom is Stages.Battle or Stages.Boss) + { + result.CurSong = new SongData + { + Bpm = 120, + SongLength = -1, + NumLoops = 5, + }; + } + + return result; + } } diff --git a/scenes/BattleDirector/scripts/BattleDirector.cs b/scenes/BattleDirector/scripts/BattleDirector.cs index b1dc9afa..bde2fff5 100644 --- a/scenes/BattleDirector/scripts/BattleDirector.cs +++ b/scenes/BattleDirector/scripts/BattleDirector.cs @@ -32,8 +32,6 @@ public partial class BattleDirector : Node2D private SongData _curSong; - private bool _battleEnd; - #endregion #region Note Handling @@ -63,12 +61,11 @@ public PuppetTemplate GetTarget(Note note) public override void _Ready() { //TODO: Should come from transition into battle - _curSong = new SongData + _curSong = StageProducer.Config.CurSong; + if (_curSong.SongLength <= 0) { - Bpm = 120, - SongLength = Audio.Stream.GetLength(), - NumLoops = 5, - }; + _curSong.SongLength = Audio.Stream.GetLength(); + } TimeKeeper.Bpm = _curSong.Bpm; Player = GD.Load("res://scenes/Puppets/PlayerPuppet.tscn") @@ -119,12 +116,16 @@ private void Begin() Audio.Play(); } + private void EndBattle() + { + StageProducer.ChangeCurRoom(StageProducer.Config.BattleRoom); + GetNode("/root/StageProducer").TransitionStage(Stages.Map); + } + public override void _Process(double delta) { TimeKeeper.CurrentTime = Audio.GetPlaybackPosition(); CD.CheckMiss(); - if (_battleEnd) - GetNode("/root/StageProducer").TransitionStage(Stages.Map); } #endregion @@ -137,24 +138,9 @@ public override void _UnhandledInput(InputEvent @event) { if (eventKey.Keycode == Key.Key0) { - //DebugKillEnemy(); + DebugKillEnemy(); } } - - if (@event.IsActionPressed("Pause")) - { - var pauseMenu = GD.Load("res://scenes/UI/Pause.tscn"); - GetNode("UILayer").AddChild(pauseMenu.Instantiate()); - GetTree().Paused = true; - } - if (@event.IsActionPressed("Inventory")) - { - var invenMenu = GD.Load("res://scenes/UI/inventory.tscn") - .Instantiate(); - GetNode("UILayer").AddChild(invenMenu); - invenMenu.Display(Player.Stats); - GetTree().Paused = true; - } } private void OnNotePressed(ArrowType type) @@ -213,6 +199,7 @@ private void CheckBattleStatus(PuppetTemplate puppet) if (puppet == Player) { GD.Print("Player is Dead"); + Audio.StreamPaused = true; GetNode("/root/StageProducer").TransitionStage(Stages.Title); return; } @@ -220,19 +207,15 @@ private void CheckBattleStatus(PuppetTemplate puppet) //will have to adjust this to account for when we have multiple enemies at once if (puppet == Enemy) { + Audio.StreamPaused = true; GD.Print("Enemy is dead"); ShowRewardSelection(3); - _battleEnd = true; } } private void ShowRewardSelection(int amount) { - var rewardUI = GD.Load("res://scenes/UI/RewardSelectionUI.tscn") - .Instantiate(); - AddChild(rewardUI); - rewardUI.Initialize(Player.Stats, amount); - GetTree().Paused = true; + RewardSelect.CreateSelection(this, Player.Stats, amount).Selected += EndBattle; } #endregion diff --git a/scenes/BattleDirector/test_battle_scene.tscn b/scenes/BattleDirector/test_battle_scene.tscn index 90172f6a..e0b58697 100644 --- a/scenes/BattleDirector/test_battle_scene.tscn +++ b/scenes/BattleDirector/test_battle_scene.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=10 format=3 uid="uid://b0mrgr7h0ty1y"] +[gd_scene load_steps=11 format=3 uid="uid://b0mrgr7h0ty1y"] [ext_resource type="Script" path="res://scenes/BattleDirector/scripts/BattleDirector.cs" id="1_cwqqr"] [ext_resource type="PackedScene" uid="uid://dfevfib11kou1" path="res://scenes/ChartViewport/ChartViewport.tscn" id="2_cupb3"] [ext_resource type="Script" path="res://scenes/BattleDirector/scripts/Conductor.cs" id="2_pcp76"] +[ext_resource type="Script" path="res://scenes/UI/scripts/MenuModule.cs" id="3_8hff6"] [ext_resource type="Texture2D" uid="uid://qhwve7fik4do" path="res://scenes/BattleDirector/assets/bgupdate.png" id="4_13o87"] [ext_resource type="Texture2D" uid="uid://dbjotl0v1ymia" path="res://scenes/BattleDirector/assets/BattleFrame1.png" id="6_0ak0g"] [ext_resource type="PackedScene" uid="uid://duhiilcv4tat3" path="res://scenes/BattleDirector/NotePlacementBar.tscn" id="7_3ko4g"] @@ -30,6 +31,7 @@ metadata/_edit_lock_ = true stream = ExtResource("8_caqms") [node name="UILayer" type="CanvasLayer" parent="."] +script = ExtResource("3_8hff6") [node name="Conductor" type="Node" parent="." node_paths=PackedStringArray("CM")] script = ExtResource("2_pcp76") diff --git a/scenes/ChestScene/ChestScene.cs b/scenes/ChestScene/ChestScene.cs new file mode 100644 index 00000000..4688d79f --- /dev/null +++ b/scenes/ChestScene/ChestScene.cs @@ -0,0 +1,40 @@ +using System; +using FunkEngine; +using Godot; + +public partial class ChestScene : Node2D +{ + public PlayerPuppet Player; + + [Export] + public Button ChestButton; + + public override void _Ready() + { + Player = GD.Load("res://scenes/Puppets/PlayerPuppet.tscn") + .Instantiate(); + AddChild(Player); + + ChestButton.Pressed += GetLoot; + } + + public override void _Process(double delta) + { + if (!ChestButton.Disabled) + { + ChestButton.GrabFocus(); + } + } + + private void GetLoot() + { + ChestButton.Disabled = true; + RewardSelect.CreateSelection(this, Player.Stats, 3).Selected += EndBattle; + } + + private void EndBattle() + { + StageProducer.ChangeCurRoom(StageProducer.Config.BattleRoom); + GetNode("/root/StageProducer").TransitionStage(Stages.Map); + } +} diff --git a/scenes/ChestScene/ChestScene.tscn b/scenes/ChestScene/ChestScene.tscn new file mode 100644 index 00000000..ccce24e2 --- /dev/null +++ b/scenes/ChestScene/ChestScene.tscn @@ -0,0 +1,39 @@ +[gd_scene load_steps=7 format=3 uid="uid://c4vmb783d3v03"] + +[ext_resource type="Script" path="res://scenes/ChestScene/ChestScene.cs" id="1_ardd2"] +[ext_resource type="AudioStream" uid="uid://cv6lqjj6lu36h" path="res://Audio/335571__magntron__gamemusic_120bpm.mp3" id="2_ogp8i"] +[ext_resource type="Script" path="res://scenes/UI/scripts/MenuModule.cs" id="3_5uvci"] +[ext_resource type="Texture2D" uid="uid://qhwve7fik4do" path="res://scenes/BattleDirector/assets/bgupdate.png" id="6_37nar"] +[ext_resource type="Texture2D" uid="uid://d0ywqw1j1k71v" path="res://scenes/ChestScene/assets/Chest.png" id="6_58hf4"] +[ext_resource type="Texture2D" uid="uid://dbjotl0v1ymia" path="res://scenes/BattleDirector/assets/BattleFrame1.png" id="7_kkck7"] + +[node name="ChestScene" type="Node2D" node_paths=PackedStringArray("ChestButton")] +process_mode = 1 +script = ExtResource("1_ardd2") +ChestButton = NodePath("ChestButton") + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource("2_ogp8i") + +[node name="UILayer" type="CanvasLayer" parent="."] +script = ExtResource("3_5uvci") + +[node name="BackGround" type="TextureRect" parent="."] +z_index = -1 +offset_right = 640.0 +offset_bottom = 178.0 +texture = ExtResource("6_37nar") + +[node name="BattleFrame" type="TextureRect" parent="."] +z_index = 1 +offset_top = 178.0 +offset_right = 640.0 +offset_bottom = 360.0 +texture = ExtResource("7_kkck7") + +[node name="ChestButton" type="Button" parent="."] +offset_left = 375.0 +offset_top = 126.0 +offset_right = 431.0 +offset_bottom = 166.0 +icon = ExtResource("6_58hf4") diff --git a/scenes/ChestScene/assets/Chest.png b/scenes/ChestScene/assets/Chest.png new file mode 100644 index 0000000000000000000000000000000000000000..2763b0527c443d73827c277ee8ec541c74936de1 GIT binary patch literal 1298 zcmV+t1?~EYP)Px(%t=H+R9J=WmtANaRTRg6+1c6De2{jVNk~^r1W8_m8ibk>2-Q4@Efg`;JVZ(< zLhM5y8WE}yAH+}*>XV{D2th0&f=D4!!3JzvXt0pPin{yMh|5wZyD@B%vYqV4hr4(7 z&di-@s;~LOuy^mAbMOCr+(A>P2nVGLcd1_xs@&~fF0C39N0DSn#4L}fh?Mx5d zR;x$PH0oSgKcaL^L(r%@G{oH86=JzGEqm(S_gjxW6>3B*%rZ&bDQ~+QguyiGJmlqn z^@-Az4(gw%D{ z+bXkmZ*W|sq-sNPiPC24?$ zgo%lvmGQ&l6pf5i4$i63P!TX7mFg6OLdN6GFvxddWOWF0N~BJ?Omp+zzLX=Y{~V8Hul&OuR(M^9J1sYxN32J+p~)w_B^ zu^3KCL~p~c&6#lnXR9nCS6qNs;o0L|k>1uJ7=dDKcz1o1_NIm!8I?rbz(kNxbpVo$ zkC0herMq>XtGE0YCGzM-#O`g|V-*-O?mBedF^9QmL-$0#$O! zHh0lvvW>Cf5h%jsm-~5rBG2~kLT+gMCHnh^!r4`Ec5nm`SL_$_mppsT&0PWT9A1A# z4n*L>w-cn(zW`uaHibgXZL&UCR);$tJ1XAwJkic);{bV9@=z+7%+6kRbuFtSK;E`< z%+3xgGnd^S2q2bA1F%soOO4&n1l9<>g;IqK6f*Arx8D=DOwNW6F7%M9rq<}`UM8m& zIMVkUNBTssGx$n7$;Np%h5WiQEmP9C=T4H%E_3I`cY(^<+9+h5a#>rAHFcm%c->bA zIv)))RUAGQ$wplAK%_2+w9ICg13ge!@lp|bjdoQJDd>xodX1`NL!oPSs!;RZUBB8& zJP29?EUSafl|LdYuv$%3In^*JM*_G{KqjhstK_4M2|WW*w6O+d1Mydwa*dkY#m1A>$USFcNAC_zevh;ERH4ysRw{ z?QI++OIN zsgv&flgEP#C6jI1o(bTi?`yr&z^U3;>^I`db@jhk`=G+x3+c#f4Oq#8Y~~6DZ!aXF zeltt>^D~=W_Q+XQhdZZ^&kl("res://scenes/UI/Pause.tscn"); + AddChild(pauseMenu.Instantiate()); + GetTree().Paused = true; + } + if (@event.IsActionPressed("Inventory")) + { + var invenMenu = GD.Load("res://scenes/UI/inventory.tscn") + .Instantiate(); + AddChild(invenMenu); + invenMenu.Display(StageProducer.PlayerStats ?? new PlayerStats()); //For now work around for testing + GetTree().Paused = true; + } + } +} diff --git a/scenes/UI/scripts/RewardSelect.cs b/scenes/UI/scripts/RewardSelect.cs index 865ddd10..00e3a039 100644 --- a/scenes/UI/scripts/RewardSelect.cs +++ b/scenes/UI/scripts/RewardSelect.cs @@ -16,6 +16,9 @@ public partial class RewardSelect : CanvasLayer [Export] private Button _skipButton; + public delegate void SelectionMadeHandler(); + public event SelectionMadeHandler Selected; + private PlayerStats _player; private RelicTemplate[] _choices; private RelicTemplate _selection; @@ -50,6 +53,17 @@ private void GenerateRelicChoices(int amount = 1) } } + public static RewardSelect CreateSelection(Node2D parent, PlayerStats playerStats, int amount) + { + var rewardUI = GD.Load("res://scenes/UI/RewardSelectionUI.tscn") + .Instantiate(); + parent.AddChild(rewardUI); + rewardUI.Initialize(playerStats, amount); + parent.GetTree().Paused = true; + + return rewardUI; + } + private void OnRelicSelected(RelicTemplate choiceRelic) { _selection = choiceRelic; @@ -63,6 +77,7 @@ private void OnSelect() GD.Print("Relic selected: " + _selection.Name); _player.AddRelic(_selection); GetTree().Paused = false; + Selected?.Invoke(); QueueFree(); } @@ -70,6 +85,7 @@ private void OnSkip() { GD.Print("Relic skipped."); GetTree().Paused = false; + Selected?.Invoke(); QueueFree(); } } From 7aa6bf1934d7ce6adec1fff410814dbe0d2eb8be Mon Sep 17 00:00:00 2001 From: LifeHckr Date: Sat, 22 Feb 2025 15:02:25 -0800 Subject: [PATCH 2/5] Added room transition animation +Small tweak to room picking on map generation --- Globals/FunkEngineNameSpace.cs | 17 ++++++--- scenes/Maps/assets/Player.png | Bin 0 -> 701 bytes scenes/Maps/assets/Player.png.import | 34 +++++++++++++++++ scenes/Maps/cartographer.tscn | 15 +++++++- scenes/Maps/scripts/Cartographer.cs | 55 ++++++++++++++++++++++----- 5 files changed, 104 insertions(+), 17 deletions(-) create mode 100644 scenes/Maps/assets/Player.png create mode 100644 scenes/Maps/assets/Player.png.import diff --git a/Globals/FunkEngineNameSpace.cs b/Globals/FunkEngineNameSpace.cs index bafd8e1c..b2eb208f 100644 --- a/Globals/FunkEngineNameSpace.cs +++ b/Globals/FunkEngineNameSpace.cs @@ -132,11 +132,7 @@ private void GeneratePath_r(int x, int y, int width, int height) _rooms = _rooms.Append(new Room(_curIdx, nextX, y + 1)).ToArray(); _map[nextX, y + 1] = _curIdx; _rooms[_map[x, y]].AddChild(_curIdx++); - _rooms[^1].SetType(Stages.Battle); - if (y > 0 && y % 3 == 0) - { - _rooms[^1].SetType(Stages.Chest); - } + _rooms[^1].SetType(PickRoomType(x, y)); } else { @@ -148,6 +144,17 @@ private void GeneratePath_r(int x, int y, int width, int height) } } + private Stages PickRoomType(int x, int y) + { + if (y <= 2) + return Stages.Battle; + if (y % 3 == 0) + return Stages.Chest; + if (StageProducer.GlobalRng.Randf() < .1) + return Stages.Chest; + return Stages.Battle; + } + //Asserts that if there is a room at the same x, but y+1 they are connected private void CreateCommonChildren(int width, int height) { diff --git a/scenes/Maps/assets/Player.png b/scenes/Maps/assets/Player.png new file mode 100644 index 0000000000000000000000000000000000000000..ba949b599cc2e97ca2d1ad08765a6396eb51e92e GIT binary patch literal 701 zcmV;u0z&Px%cS%G+R9J<*Ry}JQK@feXQ{xmiR|L5W5^5qx;3`<1;UIq@O~C)a+#isN(;qPU z2WniUOp^qII;mHrCdNjcLJDE93?UqwLY~v?-t6sNl<0xr?)Kxoc{4jJ4|{+bL<#_K zHw6IPk8jek%02|x$m^Z({|iuqND(7gFy@)olZ(z{IGN9|cuKH%O0;NfF4%IIJ&jl&>HtPvuBcgnB;vYxHs68yVlkTQsM0xH= zrzazT$U9$_9srEr9T%>66XvlKMX4xM5-|sfs68yRn{pRy(Kp)G2Ig!irUPfK6W0<^ z03fFzSHM3ZcZeu_9q&XASkq&5fJaZ{{oyDxuX}NxKD)*x7YaMjACA!d`gybIhfRN= z_moT+*F*^}RN}x_^pl9sS|{1anhv$bxa15WwSolnR*820dG5`Px)xx7}_wa&aB2gWf9H{2{T`0YzW$ zgt#ByXkCz7ZF`p1am0bIJTv!zoPP;K#&cgN6|4@bCV3ffva&Tma5kcyJD@;bs1ZrG z;!ebtyTD2Et=Uunuw1VZzHgQ0o_$)R&u?yT%iV^*PEXbM$44yJ>&#f5n2*=nqxSmn jFnz8a9N^`2s&W1Sn)X}Ky9kgD00000NkvXXu0mjfMTI;Y literal 0 HcmV?d00001 diff --git a/scenes/Maps/assets/Player.png.import b/scenes/Maps/assets/Player.png.import new file mode 100644 index 00000000..f61770d4 --- /dev/null +++ b/scenes/Maps/assets/Player.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cmc7gcplqnebx" +path="res://.godot/imported/Player.png-7fca1835a2d8df851a542a69dff404ad.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/Maps/assets/Player.png" +dest_files=["res://.godot/imported/Player.png-7fca1835a2d8df851a542a69dff404ad.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/Maps/cartographer.tscn b/scenes/Maps/cartographer.tscn index 8c948541..3fe2121b 100644 --- a/scenes/Maps/cartographer.tscn +++ b/scenes/Maps/cartographer.tscn @@ -1,13 +1,24 @@ -[gd_scene load_steps=3 format=3 uid="uid://cydmo2lbnj1de"] +[gd_scene load_steps=5 format=3 uid="uid://cydmo2lbnj1de"] [ext_resource type="Script" path="res://scenes/Maps/scripts/Cartographer.cs" id="1_u4q3n"] [ext_resource type="Texture2D" uid="uid://qhwve7fik4do" path="res://scenes/BattleDirector/assets/bgupdate.png" id="2_5g6at"] +[ext_resource type="Script" path="res://scenes/UI/scripts/MenuModule.cs" id="2_cl7v0"] +[ext_resource type="Texture2D" uid="uid://cmc7gcplqnebx" path="res://scenes/Maps/assets/Player.png" id="3_qiprp"] -[node name="Cartographer" type="Node2D"] +[node name="Cartographer" type="Node2D" node_paths=PackedStringArray("PlayerSprite")] +process_mode = 1 script = ExtResource("1_u4q3n") +PlayerSprite = NodePath("Player") + +[node name="UI" type="CanvasLayer" parent="."] +script = ExtResource("2_cl7v0") [node name="BG" type="Sprite2D" parent="."] modulate = Color(0.462, 0.462, 0.66, 1) position = Vector2(870, 219) scale = Vector2(2.75702, 2.75702) texture = ExtResource("2_5g6at") + +[node name="Player" type="Sprite2D" parent="."] +z_index = 2 +texture = ExtResource("3_qiprp") diff --git a/scenes/Maps/scripts/Cartographer.cs b/scenes/Maps/scripts/Cartographer.cs index ab7ceee1..473de0d5 100644 --- a/scenes/Maps/scripts/Cartographer.cs +++ b/scenes/Maps/scripts/Cartographer.cs @@ -5,11 +5,32 @@ public partial class Cartographer : Node2D { - private Button[] validButtons = Array.Empty