diff --git a/DangerousD/GameCore/GameObjects/Entities/Trigger.cs b/DangerousD/GameCore/GameObjects/Entities/Trigger.cs new file mode 100644 index 0000000..72c1a80 --- /dev/null +++ b/DangerousD/GameCore/GameObjects/Entities/Trigger.cs @@ -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 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() { "SilasBallMove" }, "SilasBallMove"); + public override void OnCollision(GameObject gameObject) + { + OnCollisionAction?.Invoke(gameObject); + } + public override void Update(GameTime gameTime) + { + } + public override void Draw(SpriteBatch spriteBatch) + { + } + } +}