George Sykes ELEC2645 project

Dependencies:   mbed

https://os.mbed.com/media/uploads/el18gs/pixil-frame-0.png

GHOST HUNTER

In a world of ghostly horrors there is much money to be made in underground ghost fighting rings. You've managed to get hold of a Ghostbuster, a special piece of equipment that allows you to catch, train and fight ghosts.

Instructions

Below you will find the instructions for the game. Please note that due to COVID-19 a large part of the game (fighting ghosts) could not be added as it would have required access to a second gamepad which i could not acquire.

Welcome screen

When first started you will be presented with a welcome screen

  • Pot 1 to adjust the contrast on the screen
  • Press A to continue.

Main menu

You have three options, catch ghosts (add ghosts to your inventory), inventory (sell ghosts) or settings(adjust the games settings).

  • Press X and B to move the selection up and down respectively
  • Press A to enter the selected submenu

Catch Ghost

Will now be presented with two challenges. In the first you need to find a ghost, in the second you catch it. Theses stages will start automatically.

Find ghost

Rotate the gamepad on its roll and pitch axis until all the LED's turn on. The ones on the left indicate roll and the right pitch.

  • Rotate the gamepad on it roll and pitch to light up the LED's

Catch ghost

Return the gamepad to a comfortable position and use the joystick to move the crosshairs onto the ghost sprite. When ready press the A button to catch the ghost. You will be told what kind of ghost you have captured and it will be added to your inventory.

  • Press A to catch the ghost
  • Move the joystick to move the crosshairs

Inventory

The inventory allows you to view your ghosts and sell them.

  • Use Pot 1 to scroll through the ghosts
  • Pot 2 to scroll up and down the details of the individual ghosts
  • Press X to prepare to sell a ghost and press again to confirm, if you don't press again the sale screen will disappear after 5 seconds
  • Press Start to return to the main menu

Settings

This menu allows you to adjust some of the settings of the game.

  • Press X to go up one option
  • Press B to go down one option
  • Press A to enter the selected submenu
  • Press Start to return to the main menu

Contrast

Set the contrast of the LCD screen, the contrast will adjust on this screen so you can see the effect (contrast is bounded between 0.4 and 0.6).

  • Pot 1 to increase or decrease the contrast
  • Press A to set the contrast

Button Delay

Set the minimum time between button presses; if this is too low the game will detect two button presses when there was only one, too high and the buttons will seem unresponsive. So as to ensure these issues do not occur while changing the setting button X temporarily operates on the new delay but none of the others will until A is pressed.

  • Pot 1 to increase or decrease the delay
  • Press X to test the new delay, this will toggle the small circle to be filled in or unfilled
  • Press A to save the setting
Committer:
el18gs
Date:
Tue May 26 13:37:32 2020 +0000
Revision:
17:3ebcf7bba112
Parent:
1:8d14be858ca0
Final Submission. I have read and agreed with Statement of Academic Integrity.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el18gs 1:8d14be858ca0 1 #ifndef BITMAP_H
el18gs 1:8d14be858ca0 2 #define BITMAP_H
el18gs 1:8d14be858ca0 3
el18gs 1:8d14be858ca0 4 #include <vector>
el18gs 1:8d14be858ca0 5
el18gs 1:8d14be858ca0 6 // Forward declarations
el18gs 1:8d14be858ca0 7 class N5110;
el18gs 1:8d14be858ca0 8
el18gs 1:8d14be858ca0 9 /**
el18gs 1:8d14be858ca0 10 * @brief A black & white bitmap that can be rendered on an N5110 screen
el18gs 1:8d14be858ca0 11 * @author Alex Valavanis <a.valavanis@leeds.ac.uk>
el18gs 1:8d14be858ca0 12 *
el18gs 1:8d14be858ca0 13 * @code
el18gs 1:8d14be858ca0 14 // First declare the pixel map data using '1' for black,
el18gs 1:8d14be858ca0 15 // or '0' for white pixels
el18gs 1:8d14be858ca0 16 static int sprite_data[] = {
el18gs 1:8d14be858ca0 17 0,0,1,0,0,
el18gs 1:8d14be858ca0 18 0,1,1,1,0,
el18gs 1:8d14be858ca0 19 0,0,1,0,0,
el18gs 1:8d14be858ca0 20 0,1,1,1,0,
el18gs 1:8d14be858ca0 21 1,1,1,1,1,
el18gs 1:8d14be858ca0 22 1,1,1,1,1,
el18gs 1:8d14be858ca0 23 1,1,0,1,1,
el18gs 1:8d14be858ca0 24 1,1,0,1,1
el18gs 1:8d14be858ca0 25 };
el18gs 1:8d14be858ca0 26
el18gs 1:8d14be858ca0 27 // Instantiate the Bitmap object using the data above
el18gs 1:8d14be858ca0 28 Bitmap sprite(sprite_data, 8, 5); // Specify rows and columns in sprite
el18gs 1:8d14be858ca0 29
el18gs 1:8d14be858ca0 30 // We can render the bitmap wherever we want on the screen
el18gs 1:8d14be858ca0 31 sprite.render(lcd, 20, 6); // x and y locations for rendering
el18gs 1:8d14be858ca0 32 sprite.render(lcd, 30, 10);
el18gs 1:8d14be858ca0 33
el18gs 1:8d14be858ca0 34 // We can also print its values to the terminal
el18gs 1:8d14be858ca0 35 sprite.print();
el18gs 1:8d14be858ca0 36 * @endcode
el18gs 1:8d14be858ca0 37 */
el18gs 1:8d14be858ca0 38 class Bitmap
el18gs 1:8d14be858ca0 39 {
el18gs 1:8d14be858ca0 40 private:
el18gs 1:8d14be858ca0 41 /**
el18gs 1:8d14be858ca0 42 * @brief The contents of the drawing, with pixels stored in row-major order
el18gs 1:8d14be858ca0 43 * @details '1' represents a black pixel; '0' represents white
el18gs 1:8d14be858ca0 44 */
el18gs 1:8d14be858ca0 45 std::vector<int> _contents;
el18gs 1:8d14be858ca0 46
el18gs 1:8d14be858ca0 47 unsigned int _height; ///< The height of the drawing in pixels
el18gs 1:8d14be858ca0 48 unsigned int _width; ///< The width of the drawing in pixels
el18gs 1:8d14be858ca0 49
el18gs 1:8d14be858ca0 50 public:
el18gs 1:8d14be858ca0 51 Bitmap(int const *contents,
el18gs 1:8d14be858ca0 52 unsigned int const height,
el18gs 1:8d14be858ca0 53 unsigned int const width);
el18gs 1:8d14be858ca0 54
el18gs 1:8d14be858ca0 55 int get_pixel(unsigned int const row,
el18gs 1:8d14be858ca0 56 unsigned int const column) const;
el18gs 1:8d14be858ca0 57
el18gs 1:8d14be858ca0 58 void print() const;
el18gs 1:8d14be858ca0 59
el18gs 1:8d14be858ca0 60 void render(N5110 &lcd,
el18gs 1:8d14be858ca0 61 unsigned int const x0,
el18gs 1:8d14be858ca0 62 unsigned int const y0) const;
el18gs 1:8d14be858ca0 63 };
el18gs 1:8d14be858ca0 64
el18gs 1:8d14be858ca0 65 #endif // BITMAP_H