GameObjects prepared for map
This commit is contained in:
parent
10052927ae
commit
54aded7c1d
2 changed files with 7 additions and 5 deletions
|
@ -10,13 +10,13 @@ using ZoFo.GameCore.ZoFo_graphics;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects.MapObjects
|
namespace ZoFo.GameCore.GameObjects.MapObjects
|
||||||
{
|
{
|
||||||
internal class MapObject : GameObject
|
public class MapObject : GameObject
|
||||||
{
|
{
|
||||||
public virtual bool IsColliderOn { get; protected set; } = true;
|
public virtual bool IsColliderOn { get; protected set; } = true;
|
||||||
private Rectangle _sourceRectangle;
|
private Rectangle _sourceRectangle;
|
||||||
protected override GraphicsComponent graphicsComponent => new("tiles");
|
protected override GraphicsComponent graphicsComponent => new("tiles");
|
||||||
|
|
||||||
public MapObject(Vector2 position, Vector2 size, Rectangle sourceRectangle) : base(position)
|
public MapObject(Vector2 position, Vector2 size, Rectangle sourceRectangle, string textureName) : base(position)
|
||||||
{
|
{
|
||||||
_sourceRectangle = sourceRectangle;
|
_sourceRectangle = sourceRectangle;
|
||||||
graphicsComponent.ObjectDrawRectangle = new Rectangle(0,0, (int)size.X, (int)size.Y);
|
graphicsComponent.ObjectDrawRectangle = new Rectangle(0,0, (int)size.X, (int)size.Y);
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using System;
|
using System;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
using ZoFo.GameCore.ZoFo_graphics;
|
using ZoFo.GameCore.ZoFo_graphics;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects.MapObjects.StopObjects;
|
namespace ZoFo.GameCore.GameObjects.MapObjects.StopObjects;
|
||||||
|
|
||||||
public abstract class StopObject : GameObject
|
public class StopObject : MapObject
|
||||||
{
|
{
|
||||||
protected StopObject(Vector2 position) : base(position)
|
CollisionComponent collisionComponent;
|
||||||
|
|
||||||
|
protected StopObject(Vector2 position, Vector2 size, Rectangle sourceRectangle) : base(position, size, sourceRectangle)
|
||||||
{
|
{
|
||||||
//TODO
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue