public Interface(QuickGameScene scene) { Scene = scene; var screen = Engine.GetScreenBoundary().Position; var tileset = GameTiles.Border(); border = new BorderedRectangle(tileset, new Rectangle(0, 0, screen.Width.SnapTo(tileset.Texture.CellSize.X), 30.SnapTo(tileset.Texture.CellSize.Y)), scene.InterfaceLayer); hearts = new IconCounter(scene.Player.DamageHandler.Hitpoints.GetMax(), Textures.HeartTexture, 0, 1, 2, scene.InterfaceLayer); hearts.Position.SetCorner(8, 4); ScoreLabel = new DynamicText <King>(scene.Player, p => "SCORE: " + p.Score.ToString("000000"), Fonts.SmallFont, scene.InterfaceLayer); ScoreLabel.DockInside(border, BorderSide.Right).Nudge(-4, 0); scene.AddObject(this); }
public PauseHandler() { var scene = QuickGameScene.Current; scene.AddObject(this); pauseInputCondition = new InputCondition(GameKeys.Start, Input.GetInput(scene)); foreach (var group in scene.UpdateGroups) { if (group.Priority != UpdatePriority.ModalMenu && group.Priority != UpdatePriority.Input) { group.AddPauseCondition(IsPaused); } } pauseMenu = new LayoutPanel(GameTiles.Border(), scene.InterfaceLayer); pauseMenu.AddItem(new GameText(Fonts.BigFont, "PAUSED", scene.InterfaceLayer)); pauseMenu.AddItem(new DynamicText <King>(scene.Player, p => "COINS: " + p.Coins, Fonts.BigFont, scene.InterfaceLayer)); pauseMenu.Position.Center = Engine.GetScreenSize().Center; pauseMenu.Visible = false; }
public ShopMenu(QuickGameScene scene) : base(scene.InterfaceLayer, Fonts.SmallFont, GameTiles.Border(), Input.GetInput(scene), new MenuKeys { Select = GameKeys.MenuOK, Cancel = GameKeys.Start }) { MenuPanel.AddItem(new GameText(Fonts.SmallFont, "WELCOME!", scene.InterfaceLayer)); MenuPanel.AddItem(new DynamicText <King>(scene.Player, p => "COINS: " + p.Coins, Fonts.SmallFont, scene.InterfaceLayer)); AddOption(new ExtraHeartShopItem() { Player = scene.Player, MenuPanel = MenuPanel }); AddOption(new BetterAttackShopItem() { Player = scene.Player, MenuPanel = MenuPanel }); AddOption(new ExitShopOption() { Player = scene.Player, MenuPanel = MenuPanel }); }
public ItemSelector(QuickGameScene Scene, LiveEditor editor) : base(Scene.InterfaceLayer, Fonts.SmallFont, GameTiles.Border(), Input.GetInput(Scene), new MenuKeys { Select = GameKeys.MenuOK, Cancel = GameKeys.EditorMenu }) { foreach (var cellType in EnumHelper.GetValues <CellType>().Where(p => p != CellType.Empty)) { AddOption(new EditorItem() { ItemType = cellType, Editor = editor }); } }
public EditorMenu(QuickGameScene Scene, LiveEditor editor) : base(Scene.InterfaceLayer, Fonts.SmallFont, GameTiles.Border(), Input.GetInput(Scene), new MenuKeys { Select = GameKeys.MenuOK, Cancel = GameKeys.EditorMenu }) { AddOption(new ItemsOption() { Editor = editor }); AddOption(new FreezeItemsOption(Scene) { Editor = editor }); AddOption(new ReloadOption(Scene) { Editor = editor }); AddOption(new SaveLevelOption() { Editor = editor }); AddOption(new CancelOption() { Editor = editor }); }