From 723e66a82606ee78ca4156a0c0a850185b4c0369 Mon Sep 17 00:00:00 2001 From: Matheus Date: Mon, 18 Aug 2025 18:43:54 -0300 Subject: IT'S OVER --- scripts/Game.cs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'scripts/Game.cs') diff --git a/scripts/Game.cs b/scripts/Game.cs index f5c5240..836af84 100644 --- a/scripts/Game.cs +++ b/scripts/Game.cs @@ -3,24 +3,35 @@ using System; public partial class Game : Node { private static readonly ActorDefinition playerDefinition = GD.Load("res://assets/definitions/actor/Player.tres"); + private static readonly ActorDefinition skeletonDefinition = GD.Load("res://assets/definitions/actor/Skeleton.tres"); private Player player; - public DungeonLevel Map { get; private set; } + private Node2D actorsNode; + public MapData Map_Data { get; private set; } private InputHandler inputHandler; public override void _Ready() { base._Ready(); - Map = GetNode("Map"); + Map Map = GetNode("Map"); + + Map_Data = Map.Map_Data; inputHandler = GetNode("InputHandler"); + actorsNode = GetNode("Actors"); - player = new Player(new Vector2I(0, 0), Map, playerDefinition); + player = new Player(Vector2I.Zero, Map_Data, playerDefinition); Camera2D camera = GetNode("Camera2D"); RemoveChild(camera); player.AddChild(camera); - Map.InsertActor(player); + actorsNode.AddChild(player); + + Enemy Skeleton = new Enemy(Vector2I.Zero, Map_Data, skeletonDefinition); + actorsNode.AddChild(Skeleton); + + Map_Data.InsertActor(new Vector2I(1, 1), player); + Map_Data.InsertActor(new Vector2I(3, 4), Skeleton); } public override void _PhysicsProcess(double delta) { @@ -35,7 +46,7 @@ public partial class Game : Node { } private void HandleEnemyTurns() { - foreach (Actor actor in Map.Actors) { + foreach (Actor actor in Map_Data.Actors) { if (actor is Player) continue; GD.Print($"O {actor.ActorName} foi cuckado e não tem como agir."); -- cgit v1.2.3