ELEC2645 (2018/19) / Mbed 2 deprecated henririgby98

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

SpaceInvader Class Reference

SpaceInvader Class Reference

SpaceInvader class. More...

#include <SpaceInvader.h>

Public Member Functions

 SpaceInvader ()
 constructor
 ~SpaceInvader ()
 destructor
void init (int height, int width)
 Sets spaceinvader starting position and speed.
void draw (N5110 &lcd)
 Draw the spaceinvader.
void update (Direction d, float mag)
 Updates the position of the spaceinvader.
Vector2D get_pos ()
 Gets the position.

Detailed Description

SpaceInvader class.

Class for Spaceinvader

Version:
1.0
Author:
Henri Rigby
Date:
May 2019

Definition at line 20 of file SpaceInvader.h.


Constructor & Destructor Documentation

SpaceInvader (  )

constructor

Definition at line 2 of file SpaceInvader.cpp.

~SpaceInvader (  )

destructor

Definition at line 7 of file SpaceInvader.cpp.


Member Function Documentation

void draw ( N5110 lcd )

Draw the spaceinvader.

Returns:
draws spaceinvader

Uses designed sprite to draw a spaceinvader

Definition at line 21 of file SpaceInvader.cpp.

Vector2D get_pos (  )

Gets the position.

Returns:
position

returns the position of both the x and y coordinates

Definition at line 74 of file SpaceInvader.cpp.

void init ( int  height,
int  width 
)

Sets spaceinvader starting position and speed.

Parameters:
setsposition and speed

Sets starting position and speed of the spaceinvader

Definition at line 12 of file SpaceInvader.cpp.

void update ( Direction  d,
float  mag 
)

Updates the position of the spaceinvader.

Parameters:
setsposition

Uses movement of joystick to set position of spaceinvader

Definition at line 36 of file SpaceInvader.cpp.