Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of The_Children_of_Cronos_el15mggr by
cerinealib Class Reference
cerinealib Class More...
#include <cerinealib.h>
Public Member Functions | |
| cerinealib () | |
| Constructor. | |
| void | leds () |
| function that switches only the same number of leds on as the same number of lifes the player still have left | |
| void | init () |
| function that initialises the values for the main positions as well as the borders to 0(this will be added later when the block are dropped), the sizes to 0(appart from the main first block) because they will be then set in the game,and the x and y position where the blocks to be added will start moving | |
| void | draw (N5110 &lcd) |
| this function performs two main actuations first, it draws the blocks in movent if their bool variable is true(which means that they were not dropped yet). | |
| void | updatescr () |
| depending on if the block is moving (ordinal variables to true) or dropped(ordinal variables to false) it will update the movement from one side of the screen to the next one or it will set the block to the dropped stayed position and when it reaches to five the block count it will start a loop of switching the block x positions to their previous one,letting the game to keep going forever | |
| void | commands (DigitalOut &b, DigitalOut &a, DigitalOut &x, DigitalOut &y, Gamepad &pad) |
| if buttons pressed the block will be dropped if dropped it will increse the score and let the next block moving variable to true (ordinal variable) as well as setting its to false | |
| void | gameover (N5110 &lcd, DigitalOut &start) |
| function that displays the game over screen and allows player to restart game once restarted,all values set to original ones | |
| bool | die () |
| void | velocities () |
| function that sets the velocity of the game and the difficulty level the highest the score the faster the game will go and the more difficult | |
| int | score () |
Detailed Description
cerinealib Class
Library for the fourth game, Cerinea Revision 1.3
- Date:
- May 2017
Definition at line 46 of file cerinealib.h.
Constructor & Destructor Documentation
| cerinealib | ( | ) |
Constructor.
Definition at line 7 of file cerinealib.cpp.
Member Function Documentation
| void commands | ( | DigitalOut & | b, |
| DigitalOut & | a, | ||
| DigitalOut & | x, | ||
| DigitalOut & | y, | ||
| Gamepad & | pad | ||
| ) |
if buttons pressed the block will be dropped if dropped it will increse the score and let the next block moving variable to true (ordinal variable) as well as setting its to false
- Parameters:
-
b/a/x/y drop block pad
Definition at line 272 of file cerinealib.cpp.
| bool die | ( | ) |
- Returns:
- true if dead
Definition at line 448 of file cerinealib.cpp.
| void draw | ( | N5110 & | lcd ) |
this function performs two main actuations first, it draws the blocks in movent if their bool variable is true(which means that they were not dropped yet).
second, if they are dropped(bool variables with the names or ordinals like first second etc set to false) the function will leave only the part over the other block and the rest(the part out of the range) will be eliminated.It also sets the size of the next block depending on the size of the block dropped it will set also the left block extreme margin as border to have a reference
- Parameters:
-
lcd for printing into the screen
Definition at line 100 of file cerinealib.cpp.
| void gameover | ( | N5110 & | lcd, |
| DigitalOut & | start | ||
| ) |
function that displays the game over screen and allows player to restart game once restarted,all values set to original ones
- Parameters:
-
lcd for drawing into the screen start for restarting the game pad for putting leds off
Definition at line 54 of file cerinealib.cpp.
| void init | ( | ) |
function that initialises the values for the main positions as well as the borders to 0(this will be added later when the block are dropped), the sizes to 0(appart from the main first block) because they will be then set in the game,and the x and y position where the blocks to be added will start moving
Definition at line 16 of file cerinealib.cpp.
| void leds | ( | ) |
function that switches only the same number of leds on as the same number of lifes the player still have left
- Parameters:
-
pad controls leds
| int score | ( | ) |
- Returns:
- score
Definition at line 11 of file cerinealib.cpp.
| void updatescr | ( | ) |
depending on if the block is moving (ordinal variables to true) or dropped(ordinal variables to false) it will update the movement from one side of the screen to the next one or it will set the block to the dropped stayed position and when it reaches to five the block count it will start a loop of switching the block x positions to their previous one,letting the game to keep going forever
Definition at line 318 of file cerinealib.cpp.
| void velocities | ( | ) |
function that sets the velocity of the game and the difficulty level the highest the score the faster the game will go and the more difficult
Definition at line 436 of file cerinealib.cpp.
Generated on Wed Jul 13 2022 07:38:17 by
1.7.2
