public GamePlayScene(GraphicsDevice device, IXleScreen screen, IXleRunner gameRunner, IXleInput xleInput, IRectangleRenderer rects, ICommandExecutor commandExecutor, XleSystemState systemState, XleRenderer renderer, GameState gameState) : base(device, 680, 440) { this.device = device; this.screen = screen; this.gameRunner = gameRunner; this.xleInput = xleInput; this.rects = rects; this.commandExecutor = commandExecutor; this.systemState = systemState; this.renderer = renderer; this.gameState = gameState; this.spriteBatch = new SpriteBatch(device); keyboard = new KeyboardEvents(); keyboard.KeyPress += (_, e) => xleInput.OnKeyPress(e); keyboard.KeyDown += (_, e) => xleInput.OnKeyDown(e.Key); keyboard.KeyUp += (_, e) => xleInput.OnKeyUp(e.Key); }
public override void Draw(SpriteBatch spriteBatch) { borderIndex++; if (borderIndex % 4 < 2) { TheMap.ColorScheme.FrameColor = FlashColor; } else { TheMap.ColorScheme.FrameColor = XleColor.Gray; } XleRenderer.Draw(spriteBatch); }
protected override void OnUpdate(GameTime time) { base.OnUpdate(time); timeLeft_ms -= (float)time.ElapsedGameTime.TotalMilliseconds; if (timeLeft_ms <= 0) { IsFinished = true; } renderer?.Update(time); XleRenderer.Update(time); DrawBelow = renderer == null; }