ELEC2645 (2018/19) / Mbed 2 deprecated el18jz_

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Menu Class Reference

Menu Class Reference

Menu Class. More...

#include <Menu.h>

Public Member Functions

 Menu ()
 Constructor.
 ~Menu ()
 Destructor.
int input (int select, Gamepad &pad)
 initial all the parameter for the snake and food.
void menus (N5110 &lcd, Gamepad &pad)
 Main menu for settings and start game.
int difficulty (N5110 &lcd, Gamepad &pad)
 select difiiculty.

Detailed Description

Menu Class.

Class for settings and start game

Author:
Zhou Jiaxin
Date:
8th May 2019

Definition at line 14 of file Menu.h.


Constructor & Destructor Documentation

Menu (  )

Constructor.

Definition at line 3 of file Menu.cpp.

~Menu (  )

Destructor.

Definition at line 7 of file Menu.cpp.


Member Function Documentation

int difficulty ( N5110 lcd,
Gamepad pad 
)

select difiiculty.

Parameters:
N5110*lcd

pointer to the N5110 object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function.

Parameters:
Gamepad*pad

pointer to the gamepad object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function.

Returns:
fps

is the frame per second, with higher fps means higher difficulty.

Definition at line 102 of file Menu.cpp.

int input ( int  select,
Gamepad pad 
)

initial all the parameter for the snake and food.

Parameters:
selectis used to switch the menu.
Gamepad*pad

pointer to the gamepad object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function.

Definition at line 11 of file Menu.cpp.

void menus ( N5110 lcd,
Gamepad pad 
)

Main menu for settings and start game.

Parameters:
N5110*lcd

pointer to the N5110 object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function.

Parameters:
Gamepad*pad

pointer to the gamepad object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function.

Definition at line 28 of file Menu.cpp.