using Microsoft.Xna.Framework; using Apos.Shapes; 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(); } 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; } }