refactor: Removed Unused Behaviours
This commit is contained in:
parent
bc7925dbab
commit
8929d3282f
|
@ -1,13 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using Syntriax.Engine.Core;
|
||||
|
||||
namespace Pong.Behaviours;
|
||||
|
||||
public class MovementMouseBehaviour : BehaviourOverride
|
||||
{
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
GameObject.Transform.Position = Mouse.GetState().Position.ToVector2D().ApplyDisplayScale();
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Syntriax.Engine.Core;
|
||||
|
||||
namespace Pong.Behaviours;
|
||||
|
||||
public class PlayAreaBehaviour : BehaviourOverride
|
||||
{
|
||||
public Action<PlayAreaBehaviour>? OnPlayAreaChanged { get; set; } = null;
|
||||
|
||||
private Vector2 _playArea = Vector2.Zero;
|
||||
|
||||
public Vector2 PlayArea
|
||||
{
|
||||
get => _playArea;
|
||||
set
|
||||
{
|
||||
if (_playArea == value)
|
||||
return;
|
||||
|
||||
_playArea = value;
|
||||
OnPlayAreaChanged?.Invoke(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
using Syntriax.Engine.Core;
|
||||
|
||||
namespace Pong.Behaviours;
|
||||
|
||||
public class RotatableBehaviour : BehaviourOverride
|
||||
{
|
||||
private KeyboardInputsBehaviour? inputs = null;
|
||||
|
||||
protected override void OnFirstActiveFrame()
|
||||
{
|
||||
if (!BehaviourController.TryGetBehaviour(out inputs))
|
||||
inputs = BehaviourController.AddBehaviour<KeyboardInputsBehaviour>();
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
if (inputs is null)
|
||||
return;
|
||||
|
||||
if (inputs.IsPressed(Microsoft.Xna.Framework.Input.Keys.NumPad4))
|
||||
Transform.Rotation += Time.Elapsed.Nanoseconds * 0.0025f;
|
||||
if (inputs.IsPressed(Microsoft.Xna.Framework.Input.Keys.NumPad6))
|
||||
Transform.Rotation -= Time.Elapsed.Nanoseconds * 0.0025f;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue