chore: updated engine again
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
using Syntriax.Engine.Core;
|
||||
using Syntriax.Engine.Integration.MonoGame;
|
||||
|
||||
namespace Pong.Behaviours;
|
||||
|
||||
public class TextScoreBehaviour : TextBehaviour, IFirstFrameUpdate
|
||||
public class TextScoreBehaviour(bool IsLeft) : TextBehaviour, IFirstFrameUpdate
|
||||
{
|
||||
public bool IsLeft { get; }
|
||||
public readonly bool IsLeft = IsLeft;
|
||||
|
||||
private PongManagerBehaviour? pongManager = null;
|
||||
private PongManagerBehaviour pongManager = null!;
|
||||
|
||||
public void FirstActiveFrame()
|
||||
{
|
||||
if (!UniverseObject.Universe.TryFindBehaviour(out pongManager))
|
||||
return;
|
||||
MonoGameWindow monoGameWindow = Universe.FindRequiredBehaviour<MonoGameWindowContainer>().Window;
|
||||
Font = monoGameWindow.Content.Load<SpriteFont>("UbuntuMono");
|
||||
|
||||
pongManager = Universe.FindRequiredBehaviour<PongManagerBehaviour>();
|
||||
|
||||
pongManager.OnScored += UpdateScores;
|
||||
pongManager.OnReset += UpdateScores;
|
||||
@@ -27,7 +31,4 @@ public class TextScoreBehaviour : TextBehaviour, IFirstFrameUpdate
|
||||
else
|
||||
Text = pongManager.ScoreRight.ToString();
|
||||
}
|
||||
|
||||
public TextScoreBehaviour(bool IsLeft) => this.IsLeft = IsLeft;
|
||||
public TextScoreBehaviour(bool IsLeft, SpriteFont font) : base(font) => this.IsLeft = IsLeft;
|
||||
}
|
||||
|
Reference in New Issue
Block a user