RUOFAN LI / Mbed 2 deprecated el17rl

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Bullet Class Reference

Bullet Class Reference

Bullet Class. More...

#include <shot.h>

Public Member Functions

 Bullet ()
 Constructor.
 ~Bullet ()
 Destructor.
void init (int x, int y, int sizeX, int sizeY)
 Initialize the position and the size of the bullet.
void draw (N5110 &lcd)
 draw the image of the bullet
void update ()
 Update the position of the bullet.
Vector2D getPos ()
 get the position of bullet in the lcd

Detailed Description

Bullet Class.

Library for one of the objects bullet of star war, University of Leeds

Author:
Huang Xinjie
Date:
May 2019

Definition at line 14 of file shot.h.


Constructor & Destructor Documentation

Bullet (  )

Constructor.

~Bullet (  )

Destructor.


Member Function Documentation

void draw ( N5110 lcd )

draw the image of the bullet

Parameters:
lcd(N5110)
Vector2D getPos (  )

get the position of bullet in the lcd

Returns:
the current postion of bullet
void init ( int  x,
int  y,
int  sizeX,
int  sizeY 
)

Initialize the position and the size of the bullet.

Parameters:
thevalue of horizontal position x (int)
thevalue of vertical position x (int)
thenumber of columns of bullet image (int)
thenumber of rows of bullet image (int)
void update (  )

Update the position of the bullet.