public override void RenderObjects() { elementList.Clear(); elementList.Add(CreateUI.CreateButton(0, 1, 3, 1.25f, () => { GameInstance.SetLevel(GameInstance.currentLevel); }, new GameFont("Continue", GameColor.RED))); elementList.Add(CreateUI.CreateButton(0, -0.5f, 3, 1.25f, () => { GameInstance.latestLevel = 2; GameInstance.SetLevel(2); }, new GameFont("New Game", GameColor.RED))); elementList.Add(CreateUI.CreateButton(0, -2f, 3, 1.25f, () => { GameInstance.SetLevel(1); }, new GameFont("Options", GameColor.RED))); elementList.Add(CreateUI.CreateButton(0, -3.5f, 3, 1.25f, () => { SaveGame.writeData(); Application.Exit(); }, new GameFont("Quit", GameColor.RED))); elementList.Add(new Text(0f, 5f, Alignment.CENTER, "Laser Amazer", GameColor.RED, 6f)); elementList.Add(new Text(0f, 4f, Alignment.CENTER, "A FEDD educational computer game.", GameColor.ORANGE, 2f)); }
public override void RenderObjects() { laserWrappers.Clear(); elementList.Clear(); timeStart = GetTime(); Dropdown du = CreateUI.createDropdown(-12f, 8f, 3f, 1f, new GameFont("Select Level", GameColor.RED)); foreach (Scene level in GameInstance.scenes) { if (level is Level && GameInstance.scenes.IndexOf(level) <= GameInstance.latestLevel) { du.AddButton(CreateUI.CreateButton(-12f, 8f, 3f, 1, () => { GameInstance.SetLevel(GameInstance.scenes.IndexOf(level)); }, new GameFont(level.getName(), GameColor.RED))); } } elementList.Add(du); elementList.Add(CreateUI.CreateButton(-12f, 9.25f, 3, 1, () => { GameInstance.SetLevel(0); }, new GameFont("Main Menu", GameColor.RED))); // Outer bounds CreateModel.CreateWall(0f, 10f, 20f, .5f); CreateModel.CreateWall(0f, -10f, 20f, .5f); CreateModel.CreateWall(-10f, 0f, .5f, 20f); CreateModel.CreateWall(10f, 0f, .5f, 20f); }
public override void RenderObjects() { elementList.Add(CreateUI.CreateButton(0, -2f, 6f, 1.5f, () => { GameInstance.SetLevel(0); }, new GameFont("Main Menu", GameColor.TEAL))); elementList.Add(CreateUI.CreateButton(0, -4f, 6f, 1.5f, () => { SaveGame.writeData(); Application.Exit(); }, new GameFont("Quit Game", GameColor.RED))); elementList.Add(new Text(0f, 3.5f, Alignment.CENTER, "Congratulations!", GameColor.ORANGE, 5f)); elementList.Add(new Text(0f, 1.5f, Alignment.CENTER, "You've completed the game.", GameColor.YELLOW, 2.5f)); }
public override void RenderObjects() { elementList.Clear(); gameList.Clear(); graphicsList.Clear(); elementList.Add(CreateUI.CreateButton(-2, 6, 3, 1.5f, () => { display = 0; }, new GameFont("Game", GameColor.TEAL))); elementList.Add(CreateUI.CreateButton(2, 6, 3, 1.5f, () => { display = 1; }, new GameFont("Graphics", GameColor.TEAL))); elementList.Add(CreateUI.CreateButton(0, -6, 6, 1.5f, () => { SaveGame.writeData(); GameInstance.SetLevel(0); }, new GameFont("Return to Main Menu", GameColor.TEAL))); gameList.Add(new Text(0f, 4f, Alignment.CENTER, "Game Options", GameColor.ORANGE, 1.5f)); gameList.Add(new Text(-9f, 1f, "Show Level Complete -", GameColor.BLUE, 1.2f)); gameList.Add(new Text(-5.4f, 0f, "Show Timer -", GameColor.BLUE, 1.2f)); complete = CreateUI.CreateButton(2f, 2.25f, 3, .8f, () => { levelComplete = !levelComplete; if (levelComplete) { complete.setLabel(new GameFont(" Yes ", GameColor.YELLOW)); } else { complete.setLabel(new GameFont(" No ", GameColor.YELLOW)); } GameInstance.levelCompleteDialogue = levelComplete; }, new GameFont(GameInstance.levelCompleteDialogue ? " Yes " : " No ", GameColor.YELLOW)); gameList.Add(complete); timer = CreateUI.CreateButton(2f, 0.25f, 3, .8f, () => { showTimer = !showTimer; if (showTimer) { timer.setLabel(new GameFont(" Yes ", GameColor.YELLOW)); } else { timer.setLabel(new GameFont(" No ", GameColor.YELLOW)); } GameInstance.showTimer = showTimer; }, new GameFont(GameInstance.showTimer ? " Yes " : " No ", GameColor.YELLOW)); gameList.Add(timer); graphicsList.Add(new Text(0f, 4f, Alignment.CENTER, "Graphics Options", GameColor.ORANGE, 1.5f)); graphicsList.Add(new Text(-9f, 1f, "Multisampling Level -", GameColor.BLUE, 1.2f)); multisampling = CreateUI.createDropdown(2f, 2.25f, 2.5f, .8f, new GameFont(" " + GameInstance.samplingLevel.ToString(), GameColor.YELLOW), new GameFont[] { new GameFont(" 0", GameColor.YELLOW), new GameFont(" 1", GameColor.YELLOW), new GameFont(" 2", GameColor.YELLOW), new GameFont(" 3", GameColor.YELLOW), new GameFont(" 4", GameColor.YELLOW) }, new Action[] { () => { GameInstance.samplingLevel = 0; multisampling.setLabel(new GameFont(" " + GameInstance.samplingLevel.ToString(), GameColor.YELLOW)); }, () => { GameInstance.samplingLevel = 1; multisampling.setLabel(new GameFont(" " + GameInstance.samplingLevel.ToString(), GameColor.YELLOW)); }, () => { GameInstance.samplingLevel = 2; multisampling.setLabel(new GameFont(" " + GameInstance.samplingLevel.ToString(), GameColor.YELLOW)); }, () => { GameInstance.samplingLevel = 3; multisampling.setLabel(new GameFont(" " + GameInstance.samplingLevel.ToString(), GameColor.YELLOW)); }, () => { GameInstance.samplingLevel = 4; multisampling.setLabel(new GameFont(" " + GameInstance.samplingLevel.ToString(), GameColor.YELLOW)); } }); graphicsList.Add(multisampling); }