diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-18 18:43:54 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-18 18:43:54 -0300 |
| commit | 723e66a82606ee78ca4156a0c0a850185b4c0369 (patch) | |
| tree | 1aafa29e16a462f812b804e2f3419387ba07b2f2 /scripts/Game.cs | |
| parent | c9057bbd88f14a4e0e572c16452c1ab9baebfe2a (diff) | |
IT'S OVER
Diffstat (limited to 'scripts/Game.cs')
| -rw-r--r-- | scripts/Game.cs | 21 |
1 files changed, 16 insertions, 5 deletions
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<ActorDefinition>("res://assets/definitions/actor/Player.tres"); + private static readonly ActorDefinition skeletonDefinition = GD.Load<ActorDefinition>("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<DungeonLevel>("Map"); + Map Map = GetNode<Map>("Map"); + + Map_Data = Map.Map_Data; inputHandler = GetNode<InputHandler>("InputHandler"); + actorsNode = GetNode<Node2D>("Actors"); - player = new Player(new Vector2I(0, 0), Map, playerDefinition); + player = new Player(Vector2I.Zero, Map_Data, playerDefinition); Camera2D camera = GetNode<Camera2D>("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."); |
