Created but not checked triggers
This commit is contained in:
parent
ea55e2b4f2
commit
64926792c9
1 changed files with 36 additions and 0 deletions
36
DangerousD/GameCore/GameObjects/Entities/Trigger.cs
Normal file
36
DangerousD/GameCore/GameObjects/Entities/Trigger.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using DangerousD.GameCore.Graphics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DangerousD.GameCore.GameObjects.Entities
|
||||
{
|
||||
internal class Trigger : Entity
|
||||
{
|
||||
public Action<GameObject> OnCollisionAction;
|
||||
string trigger_Name;
|
||||
public Trigger(Rectangle rectangle, string trigger_Name) : base(new Vector2(rectangle.X, rectangle.Y))
|
||||
{
|
||||
_pos = new Vector2(rectangle.X, rectangle.Y);
|
||||
Width = rectangle.Width;
|
||||
Height = rectangle.Height;
|
||||
this.trigger_Name = trigger_Name;
|
||||
}
|
||||
|
||||
protected override GraphicsComponent GraphicsComponent => new GraphicsComponent(new List<string>() { "SilasBallMove" }, "SilasBallMove");
|
||||
public override void OnCollision(GameObject gameObject)
|
||||
{
|
||||
OnCollisionAction?.Invoke(gameObject);
|
||||
}
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
}
|
||||
public override void Draw(SpriteBatch spriteBatch)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue