Ben Evans / Mbed 2 deprecated Defender_Game

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Map Class Reference

Map class. More...

#include <Map.h>

Inherits Position.

Public Member Functions

 Map ()
 Constructor.
 ~Map ()
 Destructor.
void init (Gamepad &pad)
 Initialises Spaceship.
void draw_map (N5110 &lcd, Direction d_)
 Draws map out of combination of random triangle hight and random length lines so map is different each new game and loops round at ends.
int get_position_x_map ()
 Gets x postion of the map for testing.
int get_length_map ()
 Gets map length.

Private Member Functions

Vector2D get_pos ()
 Gets the xy position of the sprite.

Private Attributes

int position_x_
 X position on lcd.
int position_y_
 Y position on lcd.
bool direction_
 Movement direction.

Detailed Description

Map class.

Draws

Author:
Benjamin Evans, University of Leeds
Date:
April 2020

Definition at line 14 of file Map.h.


Constructor & Destructor Documentation

Map (  )

Constructor.

Definition at line 8 of file Map.cpp.

~Map (  )

Destructor.

Definition at line 12 of file Map.cpp.


Member Function Documentation

void draw_map ( N5110 lcd,
Direction  d_ 
)

Draws map out of combination of random triangle hight and random length lines so map is different each new game and loops round at ends.

Parameters:
lcdN5110 object and
d_Direction variable for move map

Definition at line 63 of file Map.cpp.

int get_length_map (  )

Gets map length.

Returns:
map_length_

Definition at line 158 of file Map.cpp.

int get_position_x_map (  )

Gets x postion of the map for testing.

Returns:
maps x postion

Definition at line 154 of file Map.cpp.

void init ( Gamepad pad )

Initialises Spaceship.

Parameters:
pad: Gamepad object

Definition at line 16 of file Map.cpp.