public void Run() { Font sans18; sans18 = new Font("data/Joystix.ttf", 18); do { Hardware.ClearScreen(); Hardware.WriteHiddenText("By DAM Ies San Vicente 2012-2013", 200, 500, 0xCC, 0xCC, 0xCC, sans18); Hardware.WriteHiddenText("Hit ESC to return", 300, 540, 0x99, 0x99, 0x99, sans18); Hardware.ShowHiddenScreen(); Hardware.ScrollVertically(-2); Hardware.Pause(20); }while (!Hardware.KeyPressed(Hardware.KEY_ESC)); Hardware.ResetScroll(); }
public void Refresh() { Hardware.ClearScreen(); Hardware.DrawImage(board); Hardware.DrawImage(player); Hardware.UpdateScreen(); }
private void GameLoop() { float maxFrameRate = (1f / 60f) * 1000f; do { uint time = SDL.SDL_GetTicks(); ReceiveData(); Hardware.ClearScreen(); CurrentUpdateGameFunction(); CurrentRenderGameFunction(); Hardware.UpdateScreen(); SendData(); //Cap the frame rate to 60 fps uint frameTime = (SDL.SDL_GetTicks() - time); if (frameTime < maxFrameRate) { Thread.Sleep((int)(maxFrameRate - frameTime)); } //Get the total time of the frame deltaTime = (SDL.SDL_GetTicks() - time) / 10f; } while (NextScreen == ScreenType.None); }
static void Main() { Console.WriteLine("Hello!"); Console.WriteLine("Press any key to clear the screen:"); Console.ReadLine(); Hardware.ClearScreen(); }
public void Run() { Font font18 = new Font("data/Joystix.ttf", 18); Image player = new Image("data/Images/VAL_LEFT1.png"); bool validOptionChosen = false; do { Hardware.ScrollTo(0, 0); //Centering scroll to the character Hardware.ClearScreen(); Hardware.WriteHiddenText("P to Play, Q to Quit", 40, 10, 0xCC, 0xCC, 0xCC, font18); Hardware.WriteHiddenText(" Key: Action:", 40, 40, 0xCC, 0xCC, 0xCC, font18); Hardware.WriteHiddenText("W or UP Move Up", 40, 60, 0xCC, 0xCC, 0xCC, font18); Hardware.WriteHiddenText("S or Down Move Down", 40, 80, 0xCC, 0xCC, 0xCC, font18); Hardware.WriteHiddenText("D or Right Move Right", 40, 100, 0xCC, 0xCC, 0xCC, font18); Hardware.WriteHiddenText("A or Left Move Left", 40, 120, 0xCC, 0xCC, 0xCC, font18); Hardware.WriteHiddenText("Space Shot", 40, 140, 0xCC, 0xCC, 0xCC, font18); Hardware.DrawHiddenImage(player, 512, 384); Hardware.ShowHiddenScreen(); if (Hardware.KeyPressed(Hardware.KEY_P)) { validOptionChosen = true; optionChosen = options.Play; } if (Hardware.KeyPressed(Hardware.KEY_Q)) { validOptionChosen = true; optionChosen = options.Quit; } Hardware.Pause(50); }while (!validOptionChosen); }
public void Run() { Random r = new Random(); Font font18 = new Font("data/Joystix.ttf", 18); Image image = new Image("data/welcome3.png"); Image player1 = new Image("data/personaje.png"); Image player2 = new Image("data/personaje2.png"); Image welcomeText1 = Hardware.CreateImageFromText("Press P to Play", 0xCC, 0xCC, 0xCC, font18); Image welcomeText2 = Hardware.CreateImageFromText("Press Q to Quit", 0xCC, 0xCC, 0xCC, font18); Image welcomeText3 = Hardware.CreateImageFromText("Press C to Credits", 0xCC, 0xCC, 0xCC, font18); Balls[] balls = new Balls[2]; balls[0] = new Balls(g, r.Next(0, 902), r.Next(0, 680), 0); balls[1] = new Balls(g, r.Next(0, 902), r.Next(0, 680), 1); bool validOptionChosen = false; do { Hardware.ClearScreen(); Hardware.DrawHiddenImage(image, 0, 0); balls[0].Move(); balls[0].DrawOnHiddenScreen(); balls[1].Move(); balls[1].DrawOnHiddenScreen(); Hardware.DrawHiddenImage(player1, 50, 530); Hardware.DrawHiddenImage(player2, 730, 530); Hardware.DrawHiddenImage(welcomeText1, 410, 550); Hardware.DrawHiddenImage(welcomeText2, 410, 600); Hardware.DrawHiddenImage(welcomeText3, 410, 650); Hardware.ShowHiddenScreen(); if (Hardware.KeyPressed(Hardware.KEY_P) || Hardware.KeyPressed(Hardware.KEY_SPC)) { validOptionChosen = true; optionChosen = options.Play; } if (Hardware.KeyPressed(Hardware.KEY_Q)) { validOptionChosen = true; optionChosen = options.Quit; } if (Hardware.KeyPressed(Hardware.KEY_C)) { validOptionChosen = true; optionChosen = options.Credits; } Hardware.Pause(50); }while (!validOptionChosen); balls = null; }
public void DrawElements() { Hardware.ClearScreen(); level.DrawOnHiddenScreen(); pac.DrawOnHiddenScreen(); for (int i = 0; i < NUM_ENEMIES; i++) { ghosts[i].DrawOnHiddenScreen(); } scoreBoard.DrawOnHiddenScreen(); Hardware.ShowHiddenScreen(); }
public void Start() { Hardware hardware = new Hardware(SCREEN_WIDTH, SCREEN_HEIGHT, 24, false); WelcomeScreen welcome = new WelcomeScreen(hardware, this); MenuScreen menu = new MenuScreen(hardware, this); CreditsScreen credits = new CreditsScreen(hardware, this); hardware.ClearScreen(); welcome.Show(); do { hardware.ClearScreen(); menu.Show(); hardware.ClearScreen(); credits.Show(); }while (!menu.GetExit()); SetLanguaje(); }
public void Start() { Hardware hardware = new Hardware(1024, 720, 24, false); WelcomeScreen welcome = new WelcomeScreen(hardware); LanguageSelectScreen languaje = new LanguageSelectScreen(hardware); welcome.Run(); languaje.Run(); MenuScreen menu = new MenuScreen(hardware, languaje.languaje); do { GameScreen game = new GameScreen(hardware); HelpScreen help = new HelpScreen(hardware, languaje.languaje); StatsScreen stats = new StatsScreen(hardware, languaje.languaje); CreditsScreen credits = new CreditsScreen(hardware, languaje.languaje); Player p = Player.GetPlayer(); DateTime begin; DateTime timeEnd; hardware.ClearScreen(); menu.exit = false; menu.option = -1; Console.WriteLine("Menu"); menu.Run(); switch (menu.option) { case 0: help.Run(); begin = DateTime.Now; game.Run(); timeEnd = DateTime.Now; TimeSpan time = timeEnd - begin; GameOverScreen end = new GameOverScreen(hardware, time, languaje.languaje); end.Run(); break; case 1: stats.Run(); break; case 2: credits.Run(); break; } Thread.Sleep(50); } while (menu.option != 3 || hardware.IsKeyPressed(Hardware.KEY_ESC)); }
public void Run() { finished = false; Image introBackground = new Image("data/help.png"); Hardware.ClearScreen(); Hardware.DrawHiddenImage(introBackground, 0, 0); Hardware.WriteHiddenText("You play pressing the following buttons:", 180, 80, 0xEE, 0xEE, 0xEE, font18); Hardware.WriteHiddenText("Right arrow to move RIGHT >", 400, 150, 0xB0, 0xB0, 0xB0, font18); Hardware.WriteHiddenText("Left arrow to move LEFT <", 400, 230, 0xB0, 0xB0, 0xB0, font18); Hardware.WriteHiddenText("Press right arrow + up arrow to JUMP RIGHT", 250, 300, 0xB0, 0xB0, 0xB0, font18); Hardware.WriteHiddenText("Press left arrow + up arrow to JUMP LEFT", 250, 390, 0xB0, 0xB0, 0xB0, font18); Hardware.WriteHiddenText("Press 'F' key to launch a sword", 370, 500, 0xB0, 0xB0, 0xB0, font18); Hardware.WriteHiddenText("Press up arrow to climb stairs", 380, 640, 0xB0, 0xB0, 0xB0, font18); Hardware.ShowHiddenScreen(); do { Hardware.Pause(40); // Not to use a 100% CPU for nothing if (Hardware.KeyPressed(Hardware.KEY_ESC)) { finished = true; do { } while (Hardware.KeyPressed(Hardware.KEY_ESC)); } }while (!finished); }
public void Start() { Hardware hardware = new Hardware(800, 600, 24, false); WelcomeScreen welcome = new WelcomeScreen(hardware); CreditsScreen credits = new CreditsScreen(hardware); PlayerSelectScreen playerSelect = new PlayerSelectScreen(hardware); GameScreen game = new GameScreen(hardware); do { hardware.ClearScreen(); welcome.Show(); if (!welcome.GetExit()) { playerSelect.Show(); game.ChosenPlayer = playerSelect.GetChosenPlayer(); hardware.ClearScreen(); game.Show(); hardware.ClearScreen(); credits.Show(); } } while (!welcome.GetExit()); }
// Update screen public void DrawElements() { Hardware.ClearScreen(); currentLevel.DrawOnHiddenScreen(); Hardware.WriteHiddenText("Score: ", 40, 10, 0xCC, 0xCC, 0xCC, font18); player.DrawOnHiddenScreen(); for (int i = 0; i < numEnemies; i++) { enemies[i].DrawOnHiddenScreen(); } myShot.DrawOnHiddenScreen(); Hardware.ShowHiddenScreen(); }
public void Run() { Font font18 = new Font("data/Joystix.ttf", 18); Image player = new Image("data/player.png"); do { Hardware.ClearScreen(); Hardware.WriteHiddenText("Game Over! Press R to return...", 40, 10, 0xCC, 0xCC, 0xCC, font18); Hardware.DrawHiddenImage(player, 400, 300); Hardware.ShowHiddenScreen(); Hardware.Pause(50); }while (!Hardware.KeyPressed(Hardware.KEY_R)); }
public void Run() { Font font18 = new Font("data/Joystix.ttf", 18); Image player = new Image("data/ArthurRight1.png"); do { Hardware.ClearScreen(); Hardware.WriteHiddenText("Bye! Press Q to return to Operating System...", 40, 10, 0xCC, 0xCC, 0xCC, font18); Hardware.DrawHiddenImage(player, 400, 300); Hardware.ShowHiddenScreen(); Hardware.Pause(50); }while (!Hardware.KeyPressed(Hardware.KEY_Q)); }
public void Start() { Hardware hardware = new Hardware(840, 755, 24, false); WelcomeScreen welcome = new WelcomeScreen(hardware); SettingScreen setting = new SettingScreen(hardware); ControllerScreen controller = new ControllerScreen(hardware); CreditsScreen credits = new CreditsScreen(hardware); MapCreationScreen mapedition = new MapCreationScreen(hardware); SelectLenguage select = new SelectLenguage(hardware); do { hardware.ClearScreen(); select.Show(); if (!welcome.GetExit()) { welcome.Show(); switch (welcome.GetChosenOption()) { case 1: setting.Show(); break; case 2: mapedition.Show(); break; case 3: controller.Show(); break; case 4: credits.Show(); break; case 5: welcome.GetExit(); break; } } } while (!welcome.GetExit()); }
public ScreenType Run() { do { Hardware.ClearScreen(); Hardware.RenderBackground(background); foreach (Button button in buttons) { button.Render(); } HandleEvents(); Hardware.UpdateScreen(); System.Threading.Thread.Sleep(16); } while (NextScreen == ScreenType.None); return(NextScreen); }
public void Run() { Font font18 = new Font("data/Joystix.ttf", 18); Image player = new Image("data/player.png"); Image floor = new Image("data/tileBrick01.png"); int playerX = 500; int playerY = 250; do { Hardware.ClearScreen(); Hardware.WriteHiddenText("Programmed by Nacho", 400, 10, 0xCC, 0xCC, 0xCC, font18); Hardware.WriteHiddenText("Press R to return...", 394, 50, 0x80, 0x80, 0x80, font18); Hardware.DrawHiddenImage(player, playerX, playerY); for (int i = 0; i < 10; i++) { Hardware.DrawHiddenImage(floor, 100 + i * 80, 357); } Hardware.ShowHiddenScreen(); if (Hardware.KeyPressed(Hardware.KEY_LEFT)) { Hardware.ScrollHorizontally(5); playerX -= 5; } if (Hardware.KeyPressed(Hardware.KEY_RIGHT)) { Hardware.ScrollHorizontally(-5); playerX += 5; } Hardware.Pause(20); }while (!Hardware.KeyPressed(Hardware.KEY_R)); Hardware.ResetScroll(); }
public void Run() { Font font18 = new Font("data/Joystix.ttf", 18); Image player = new Image("data/playerRight1.png"); Image floor = new Image("data/Brick2.png"); int playerX = 500; int playerY = 250; Image text = Hardware.CreateImageFromText("Press R to return...", 0x80, 0x80, 0x80, font18); Image programmer = Hardware.CreateImageFromText("Programmed by Chen", 0xCC, 0xCC, 0xCC, font18); do { Hardware.ClearScreen(); Hardware.DrawHiddenImage(programmer, 400, 10); Hardware.DrawHiddenImage(text, 394, 50); Hardware.DrawHiddenImage(player, playerX, playerY); for (int i = 0; i < 30; i++) { Hardware.DrawHiddenImage(floor, 100 + i * 28, 357); } Hardware.ShowHiddenScreen(); if (Hardware.KeyPressed(Hardware.KEY_DOWN)) { Hardware.ScrollVertically(5); playerY -= 5; } if (Hardware.KeyPressed(Hardware.KEY_UP)) { Hardware.ScrollVertically(-5); playerY += 5; } Hardware.Pause(20); }while (!Hardware.KeyPressed(Hardware.KEY_R)); Hardware.ResetScroll(); }
public ScreenType Run() { Hardware.ClearScreen(); Hardware.RenderBackground(background); text.Render(Hardware.ScreenWidth / 2 - text.Width / 2, Hardware.ScreenHeight / 2 - text.Height / 2); Hardware.UpdateScreen(); do { SDL.SDL_Keycode key = Hardware.KeyPressed(); if (key == SDL.SDL_Keycode.SDLK_RETURN) { NextScreen = ScreenType.Main; } System.Threading.Thread.Sleep(16); } while (NextScreen == ScreenType.None); return(NextScreen); }
public void Run() { Font font18 = new Font("data/Joystix.ttf", 18); Font font40 = new Font("data/Joystix.ttf", 40); do { Hardware.ClearScreen(); Hardware.WriteHiddenText("GAME OVER", 380, 320, 0xFF, 0xAD, 0x8B, font40); Hardware.WriteHiddenText("Press Q to continue...", 370, 450, 0xCC, 0xCC, 0xCC, font18); Hardware.ShowHiddenScreen(); Hardware.Pause(50); }while (!Hardware.KeyPressed(Hardware.KEY_Q)); }
public void Run() { Font font18 = new Font("data/Joystix.ttf", 18); Image player = new Image("data/welcomeScreen.png"); bool validOptionChosen = false; do { Hardware.ClearScreen(); Hardware.WriteHiddenText("P to Play,C to credits,H to help, Q to Quit", 40, 10, 0xCC, 0xCC, 0xCC, font18); Hardware.DrawHiddenImage(player, 0, 30); Hardware.ShowHiddenScreen(); if (Hardware.KeyPressed(Hardware.KEY_P)) { validOptionChosen = true; optionChosen = options.Play; } if (Hardware.KeyPressed(Hardware.KEY_Q)) { validOptionChosen = true; optionChosen = options.Quit; } if (Hardware.KeyPressed(Hardware.KEY_C)) { validOptionChosen = true; optionChosen = options.Credits; } if (Hardware.KeyPressed(Hardware.KEY_H)) { validOptionChosen = true; optionChosen = options.Help; } Hardware.Pause(50); }while (!validOptionChosen); }
// Update screen public void DrawElements() { Hardware.ClearScreen(); currentLevel.DrawOnHiddenScreen(); Hardware.WriteHiddenText("Score: " + score, 40, 10, 0xCC, 0xCC, 0xCC, font18); Hardware.WriteHiddenText("Life: " + Convert.ToString(player.GetLife()), 260, 10, 0xCC, 0xCC, 0xCC, font18); Hardware.WriteHiddenText("Keys: " + Convert.ToString(player.GetKeys()), 480, 10, 0xCC, 0xCC, 0xCC, font18); player.DrawOnHiddenScreen(); for (int i = 0; i < enemies.Count; i++) { enemies[i].DrawOnHiddenScreen(); } for (int i = 0; i < keys.Count; i++) { keys[i].DrawOnHiddenScreen(); } for (int i = 0; i < doors.Count; i++) { doors[i].DrawOnHiddenScreen(); } for (int i = 0; i < generators.Count; i++) { generators[i].DrawOnHiddenScreen(); } myShot.DrawOnHiddenScreen(); Hardware.ShowHiddenScreen(); }
public void Run() { Font font18 = new Font("data/Joystix.ttf", 18); Image player = new Image("data/player.png"); Image welcomeText = Hardware.CreateImageFromText("SPACE or P to Play, Q to Quit, C for Credits", 0xCC, 0xCC, 0xCC, font18); bool validOptionChosen = false; do { Hardware.ClearScreen(); Hardware.DrawHiddenImage(welcomeText, 40, 10); Hardware.DrawHiddenImage(player, 400, 300); Hardware.ShowHiddenScreen(); if (Hardware.KeyPressed(Hardware.KEY_SPC) || Hardware.KeyPressed(Hardware.KEY_P)) { validOptionChosen = true; optionChosen = options.Play; } if (Hardware.KeyPressed(Hardware.KEY_Q)) { validOptionChosen = true; optionChosen = options.Quit; } if (Hardware.KeyPressed(Hardware.KEY_C)) { validOptionChosen = true; optionChosen = options.Credits; } Hardware.Pause(50); }while (!validOptionChosen); }
public void Run() { finished = false; Image introBackground = new Image("data/credits.jpg"); Hardware.ClearScreen(); Hardware.DrawHiddenImage(introBackground, 50, 50); Hardware.WriteHiddenText("Spriter - Pedro Antonio Pérez Paterna", 260, 280, 0xEE, 0xEE, 0xEE, font18); Hardware.WriteHiddenText("and some google sources", 350, 300, 0xEE, 0xEE, 0xEE, font18); Hardware.WriteHiddenText("Programmed by - Pedro Antonio Pérez Paterna", 270, 350, 0xB0, 0xB0, 0xB0, font18); Hardware.WriteHiddenText("using Nacho's skeleton", 350, 370, 0xB0, 0xB0, 0xB0, font18); Hardware.ShowHiddenScreen(); do { Hardware.Pause(40); // Not to use a 100% CPU for nothing if (Hardware.KeyPressed(Hardware.KEY_ESC)) { finished = true; do { } while (Hardware.KeyPressed(Hardware.KEY_ESC)); } }while (!finished); }
//Whenever the text changes, we render the new text on screen //and check if the ip is valid public void RenderTextChanged(string address) { Text ipText = new Text(font, address, 0xff, 0xff, 0xff); Hardware.ClearScreen(); Hardware.RenderBackground(background); //Renders the text on the middle of the screen ipText.Render(Hardware.ScreenWidth / 2 - ipText.Width / 2, Hardware.ScreenHeight / 2 - ipText.Height / 2); if (ValidateIPAddress(address)) { validIPText.Render (Hardware.ScreenWidth / 2 - validIPText.Width / 2, Hardware.ScreenHeight / 2 + validIPText.Height); } else { invalidIPText.Render (Hardware.ScreenWidth / 2 - invalidIPText.Width / 2, Hardware.ScreenHeight / 2 + invalidIPText.Height); } Hardware.UpdateScreen(); }
public ScreenType Run() { do { Hardware.ClearScreen(); HandleEvents(); Hardware.RenderBackground(background); foreach (Button button in buttons) { button.Render(); } //Remove later englishText.Render(Hardware.ScreenWidth / 2 - englishText.Width / 2, (int)(Hardware.ScreenHeight / 2 - Button.SPRITE_HEIGHT * 1.5)); spanishText.Render(Hardware.ScreenWidth / 2 - englishText.Width / 2, (int)(Hardware.ScreenHeight / 2 + Button.SPRITE_HEIGHT * 1.5)); Hardware.UpdateScreen(); } while (NextScreen == ScreenType.None); return(NextScreen); }
public static void Main() { bool fullScreen = false; short screenWidth = 800; short screenHeight = 600; Hardware.Init(screenWidth, screenHeight, 24, fullScreen); Image player = new Image("data\\player.bmp"); Image player2 = new Image("data\\player2.bmp"); Image bird = new Image("data\\bird.bmp"); short x = 400; short y = 250; ushort playerWidth = 50; ushort playerHeight = 107; float speed = 3.8f; float[] birdX = { 500, 200, 150, 600, 100 }; float[] birdY = { 150, 200, 300, 400, 520 }; ushort birdWidth = 48; ushort birdHeight = 48; float[] birdSpeed = { -2.8f, 1.4f, 3.2f, -1.2f, 2.0f }; byte frame = 1; bool finished = false; // Game Loop while (!finished) { // Draw elements on screen Hardware.ClearScreen(); if (frame < 5) { Hardware.DrawHiddenImage(player, x, y); } else { Hardware.DrawHiddenImage(player2, x, y); } for (int i = 0; i < 5; i++) { Hardware.DrawHiddenImage(bird, (short)birdX[i], (short)birdY[i]); } Hardware.ShowHiddenScreen(); // Check keys and move player if (Hardware.KeyPressed(Hardware.KEY_RIGHT) && (x < screenWidth - playerWidth)) { frame = (byte)((frame + 1) % 10); x += (short)speed; } if (Hardware.KeyPressed(Hardware.KEY_LEFT) && (x > 0)) { frame = (byte)((frame + 1) % 10); x -= (short)speed; } if (Hardware.KeyPressed(Hardware.KEY_UP) && (y > 0)) { frame = (byte)((frame + 1) % 10); y -= (short)speed; } if (Hardware.KeyPressed(Hardware.KEY_DOWN) && (y < screenHeight - playerHeight)) { frame = (byte)((frame + 1) % 10); y += (short)speed; } if (Hardware.KeyPressed(Hardware.KEY_ESC)) { finished = true; } // Move other elements for (int i = 0; i < 5; i++) { if ((birdX[i] > screenWidth - birdWidth) || (birdX[i] < 0)) { birdSpeed[i] = -birdSpeed[i]; } birdX[i] = (short)(birdX[i] + birdSpeed[i]); } // Check collisions and game state for (int i = 0; i < 5; i++) { if ((birdX[i] > x - birdWidth) && (birdX[i] < x + playerWidth) && (birdY[i] > y - birdHeight) && (birdY[i] < y + playerHeight)) { finished = true; } } // Pause till next frame (50fps) Hardware.Pause(20); } }
// Update screen public void DrawElements() { Hardware.ClearScreen(); Hardware.WriteHiddenText("Score: ", 80, 10, 0xCC, 0xCC, 0xCC, font18); Hardware.WriteHiddenText(player.GetPoints().ToString(), 180, 10, 0xCC, 0xCC, 0xCC, font18); Hardware.WriteHiddenText((level + 1).ToString("00"), 90, 50, 0xCC, 0xCC, 0xCC, font18); Hardware.WriteHiddenText(time.ToString("00"), 950, 10, 0xCC, 0xCC, 0xCC, font18); Hardware.WriteHiddenText("LIFE: ", 650, 10, 0xCC, 0xCC, 0xCC, font18); // Draw level on screen currentLevel.DrawOnHiddenScreen(); // Draw player life on screen for (int i = 0; i < player.GetLife(); i++) { Hardware.DrawHiddenImage(lifeImage, (int)lifeX[i], 10); } // Draw shots on screen for (int i = 0; i < shots.Count; i++) { shots[i].DrawOnHiddenScreen(); } // Draw items on screen PlaceItem(); if (itemPlaced) { for (int i = 0; i < items.Length; i++) { items[i].DrawOnHiddenScreen(); } } // Draw player on screen if (player.Dead() || player.IsImmune()) { player.DisplaySpecialFrame(); } player.DrawOnHiddenScreen(); // Draw enemies on screen for (int i = 0; i < enemies.Count; i++) { enemies[i].DrawOnHiddenScreen(); } Hardware.ShowHiddenScreen(); }
public static void Main(string[] args) { Hardware.ClearScreen(); }
public void Run() { Font sans18 = new Font("data/Joystix.ttf", 18); Image background = new Image("data/background.png"); int x = -40; Player myPlayer = new Player(); Enemy myGhost = new Enemy(); do { Hardware.ClearScreen(); Hardware.DrawHiddenImage(background, 0, 0); Hardware.WriteHiddenText("Hit SPACE to start", 300, 400, 0xCC, 0xCC, 0xCC, sans18); Hardware.WriteHiddenText("or H for Help", 330, 440, 0xAA, 0xAA, 0xAA, sans18); Hardware.WriteHiddenText("or C for Credits", 310, 480, 0x88, 0x88, 0x88, sans18); Hardware.WriteHiddenText("or Q to Quit", 340, 520, 0x66, 0x66, 0x66, sans18); myGhost.MoveTo(x - 50, 300); myGhost.NextFrame(); myGhost.DrawOnHiddenScreen(); myPlayer.MoveTo(x, 300); myPlayer.NextFrame(); myPlayer.DrawOnHiddenScreen(); x += 8; if (x > 850) { x = -40; } Hardware.ShowHiddenScreen(); Hardware.Pause(40); if (Hardware.KeyPressed(Hardware.KEY_C)) { Credits creditsScreen = new Credits(); creditsScreen.Run(); } if (Hardware.KeyPressed(Hardware.KEY_H)) { Help helpScreen = new Help(); helpScreen.Run(); } if (Hardware.KeyPressed(Hardware.KEY_SPC)) { Game myGame = new Game(); myGame.Run(); } }while (!Hardware.KeyPressed(Hardware.KEY_Q)); }