Mateo Gomez-Randulfe / Mbed 2 deprecated The_Children_of_Cronos

Dependencies:   mbed

Fork of The_Children_of_Cronos_el15mggr by ELEC2645 (2016/17)

Embed: (wiki syntax)

« Back to documentation index

game.h File Reference

game.h File Reference

Header file for the function prototyps and variables of the main game file. More...

Go to the source code of this file.

Data Structures

struct  State
 Selector. More...

Functions

DigitalOut x (PTC17)
 x button connection
DigitalOut y (PTC12)
 y button connection
DigitalOut a (PTB9)
 a button connection
DigitalOut b (PTD0)
 b button connection
DigitalOut l (PTB18)
 l button connection
DigitalOut r (PTB3)
 r button connection
DigitalOut start (PTC5)
 start button connection
DigitalOut back (PTB19)
 back button connection
N5110 lcd (PTC9, PTC0, PTC7, PTD2, PTD1, PTC11)
 lcd objct for interacting with the screen library
void init ()
 initialises all the objects like gamepad and lcd it also performs h init function of all the games
void intro ()
 brief intro with the game name in a fancy way using bitmaps
void lights ()
 switchs on progressivly the lights in the intro screen
void game ()
 displays the different games selector screen and allows to switch between them
void select ()
 function that allows to select the five different games in an up down selector using a sructure
void menuscreen ()
 executes the screen where the player can select the option he wants like tutoria,story of the game,the games screen or the scores
void menuselect ()
 function that allows to select the different menu options the player have
void drawselectmenu ()
 draws the screen that selects beween the five different games(which is inside itself of the menuselct screen
void drawselectscreen ()
 draws the screen that selects beween opions in the menu
void selected ()
 selects between different games
void tutorial ()
 displays the tutorial screen and the selecor of it.The player can choose to read the instructions of the different levels
void story ()
 displays the game sory screen and the selecor of it.The player can scrolls to keep reading the story.
void highscores ()
 displays the highest scores
void savescore ()
 saves the score if pressed and if its bigger than the thid position
void aliens ()
 performs the aliens movement
void newgame ()
 executes the screen where the player can select the game he wants
void gameone ()
 function that assemblies the first game
void gametwo ()
 function that assemblies the second game
void gamethree ()
 function that assemblies the third game
void gamefour ()
 function that assemblies the fourth game
void gamefive ()
 function that assemblies the fith game

Variables

Gamepad pad
 gamepad objct for interacting with the gamepad library
hydralib hyd
 hydralib objct for interacting with the first game library(the snake)
Stymphalianlib stym
 Stymphalianlib objct for interacting with the second game library(space invaders)
aurigaslib aurig
 aurigaslib objct for interacting with the third game library(flappy birds)
cerinealib cer
 cerinealib objct for interacting with the fourth game library(stack)
taurolib tau
 taurolib objct for interacting with the fith game library(quesions and answers)
Ticker introlights
 ticker object for switching on progressively the lights in the intro
Ticker alienmove
 ticker object for moving the aliens each second in th space invaders game
State games [5]
 structure array for the different games
State menu [4]
 structure array for the different menu options
State tuto [5]
 structure array for the tutorial options

Detailed Description

Header file for the function prototyps and variables of the main game file.

Author:
Mateo Randulfe
Date:
May 2017

Definition in file game.h.


Function Documentation

DigitalOut a ( PTB9   )

a button connection

Parameters:
a
void aliens (  )

performs the aliens movement

Definition at line 578 of file main.cpp.

DigitalOut b ( PTD0   )

b button connection

Parameters:
b
DigitalOut back ( PTB19   )

back button connection

Parameters:
back
void drawselectmenu (  )

draws the screen that selects beween the five different games(which is inside itself of the menuselct screen

Definition at line 332 of file main.cpp.

void drawselectscreen (  )

draws the screen that selects beween opions in the menu

Definition at line 305 of file main.cpp.

void game (  )

displays the different games selector screen and allows to switch between them

Definition at line 79 of file main.cpp.

void gamefive (  )

function that assemblies the fith game

Definition at line 162 of file main.cpp.

void gamefour (  )

function that assemblies the fourth game

Definition at line 182 of file main.cpp.

void gameone (  )

function that assemblies the first game

Definition at line 268 of file main.cpp.

void gamethree (  )

function that assemblies the third game

Definition at line 208 of file main.cpp.

void gametwo (  )

function that assemblies the second game

Definition at line 235 of file main.cpp.

void highscores (  )

displays the highest scores

Definition at line 471 of file main.cpp.

void init (  )

initialises all the objects like gamepad and lcd it also performs h init function of all the games

Definition at line 583 of file main.cpp.

void intro (  )

brief intro with the game name in a fancy way using bitmaps

Definition at line 362 of file main.cpp.

DigitalOut l ( PTB18   )

l button connection

Parameters:
l
N5110 lcd ( PTC9  ,
PTC0  ,
PTC7  ,
PTD2  ,
PTD1  ,
PTC11   
)

lcd objct for interacting with the screen library

Parameters:
lcd
void lights (  )

switchs on progressivly the lights in the intro screen

Definition at line 561 of file main.cpp.

void menuscreen (  )

executes the screen where the player can select the option he wants like tutoria,story of the game,the games screen or the scores

Definition at line 58 of file main.cpp.

void menuselect (  )

function that allows to select the different menu options the player have

Definition at line 101 of file main.cpp.

void newgame (  )

executes the screen where the player can select the game he wants

Definition at line 31 of file main.cpp.

DigitalOut r ( PTB3   )

r button connection

Parameters:
r
void savescore (  )

saves the score if pressed and if its bigger than the thid position

void select (  )

function that allows to select the five different games in an up down selector using a sructure

Definition at line 130 of file main.cpp.

void selected (  )

selects between different games

DigitalOut start ( PTC5   )

start button connection

Parameters:
start
void story (  )

displays the game sory screen and the selecor of it.The player can scrolls to keep reading the story.

Definition at line 412 of file main.cpp.

void tutorial (  )

displays the tutorial screen and the selecor of it.The player can choose to read the instructions of the different levels

Definition at line 497 of file main.cpp.

DigitalOut x ( PTC17   )

x button connection

Parameters:
x
DigitalOut y ( PTC12   )

y button connection

Parameters:
y

Variable Documentation

Ticker alienmove

ticker object for moving the aliens each second in th space invaders game

Definition at line 110 of file game.h.

aurigaslib objct for interacting with the third game library(flappy birds)

Parameters:
aurig

Definition at line 91 of file game.h.

cerinealib objct for interacting with the fourth game library(stack)

Parameters:
cer

Definition at line 96 of file game.h.

Initial value:
 {
    {0,{4,1}},
    {1,{0,2}},
    {2,{1,3}},
    {3,{2,4}},
    {4,{3,0}}
}

structure array for the different games

Definition at line 221 of file game.h.

hydralib objct for interacting with the first game library(the snake)

Parameters:
hyd

Definition at line 81 of file game.h.

Ticker introlights

ticker object for switching on progressively the lights in the intro

Definition at line 106 of file game.h.

State menu[4]
Initial value:
 {
    {0,{3,1}},
    {1,{0,2}},
    {2,{1,3}},
    {3,{2,0}}
}

structure array for the different menu options

Definition at line 229 of file game.h.

gamepad objct for interacting with the gamepad library

Parameters:
pad

Definition at line 76 of file game.h.

Stymphalianlib objct for interacting with the second game library(space invaders)

Parameters:
stym

Definition at line 86 of file game.h.

taurolib objct for interacting with the fith game library(quesions and answers)

Parameters:
tau

Definition at line 101 of file game.h.

State tuto[5]
Initial value:
 {
    {0,{4,1}},
    {1,{0,2}},
    {2,{1,3}},
    {3,{2,4}},
    {4,{3,0}}
}

structure array for the tutorial options

Definition at line 236 of file game.h.