diff options
Diffstat (limited to 'scripts/actors')
| -rw-r--r-- | scripts/actors/Actor.cs | 11 | ||||
| -rw-r--r-- | scripts/actors/ActorDefinition.cs | 2 | ||||
| -rw-r--r-- | scripts/actors/Player.cs | 4 |
3 files changed, 14 insertions, 3 deletions
diff --git a/scripts/actors/Actor.cs b/scripts/actors/Actor.cs index f429ead..7e9ab04 100644 --- a/scripts/actors/Actor.cs +++ b/scripts/actors/Actor.cs @@ -3,11 +3,18 @@ using Godot; [GlobalClass] public abstract partial class Actor : Sprite2D { - [Export] private ActorDefinition definition; private Vector2I gridPosition = Vector2I.Zero; - [Export] public DungeonLevel Map { get; private set; } + + public Actor(Vector2I initialPosition, DungeonLevel map, ActorDefinition definition) { + GridPosition = initialPosition; + Map = map; + this.definition = definition; + Texture = definition.texture; + Centered = false; + } + public Vector2I GridPosition { set { gridPosition = value; diff --git a/scripts/actors/ActorDefinition.cs b/scripts/actors/ActorDefinition.cs index 58a749c..5678921 100644 --- a/scripts/actors/ActorDefinition.cs +++ b/scripts/actors/ActorDefinition.cs @@ -7,6 +7,8 @@ public partial class ActorDefinition : Resource [ExportCategory("Visuals")] [Export] public string name = "unnamed"; + [Export] + public Texture2D texture; [ExportCategory("Mechanics")] [Export] diff --git a/scripts/actors/Player.cs b/scripts/actors/Player.cs index c8abe12..590020d 100644 --- a/scripts/actors/Player.cs +++ b/scripts/actors/Player.cs @@ -4,5 +4,7 @@ using System; [GlobalClass] public partial class Player : Actor { - + public Player(Vector2I initialPosition, DungeonLevel map, ActorDefinition definition) : base(initialPosition, map, definition) + { + } } |
