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.
Player Class Reference
#include <player.h>
Inherits GameObject.
Public Member Functions | |
Player () | |
A constructor of the player's ship. | |
void | updateAndDrawBlasts () |
Draws the player's blasts on the screen. | |
void | fireNewBlast () |
Makes a blast active and gives it the start positions. | |
void | updateAndDraw () |
Updates and draws player's ship (including with force shield sprite) positon. | |
void | draw () |
Updates and draws player's ship and the force shield sprites. | |
void | spawn (Point spawn_pos) |
Activates the object at the given postion. |
Detailed Description
Player Class.
Manages player's ship.
- Date:
- 15/04/2019
Definition at line 10 of file player.h.
Constructor & Destructor Documentation
Player | ( | ) |
Member Function Documentation
void draw | ( | ) |
void fireNewBlast | ( | ) |
void spawn | ( | Point | spawn_pos ) | [inherited] |
Activates the object at the given postion.
- Parameters:
-
spawn_pos sets position of x and y into pos (Point).
Definition at line 19 of file gameobject.h.
void updateAndDraw | ( | ) |
Updates and draws player's ship (including with force shield sprite) positon.
The function reads the analog input signal from joystick and moves the player's ship on the LCD accordingly.(move joystick, the ship moves up, move joystick right, the ship moves right). Also, this function checks whether the force shield was activated in game.cpp, if it was then the player's ship is replaced the exactky the same sip but with the added force shield.
void updateAndDrawBlasts | ( | ) |
Draws the player's blasts on the screen.
This function Will draw every activated blast to the left with the blast_speed. It will deactivate blasts when they leave the screen, for future reuse. If the blast does miss the enemy and leaves the screen limits, the function will substract 10 points in game_score.
Generated on Wed Dec 20 2023 20:30:17 by
