ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el19zf

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

People Class Reference

People Class Reference

People class. More...

#include <People.h>

Public Member Functions

 People ()
 Constructor.
 ~People ()
 Destructor.
void init ()
 initialize the position of people
void draw (N5110 &lcd, int flag)
 draw it on lcd and alternating type of people when running
void update ()
 update the position of people
void control_lim ()
 limit the people without going off screen
void set_pos (Vector2D p)
 accessors set the position of people only for test
void set_velocity (Direction d, float mag)
 accessors control the people by Joystick
Vector2D get_pos ()
 mutators get the position of people only for test

Detailed Description

People class.

set a basic element of my project

Author:
Zeyu Feng @9 April 2020

Definition at line 14 of file People.h.


Constructor & Destructor Documentation

People (  )

Constructor.

Definition at line 27 of file People.cpp.

~People (  )

Destructor.

Definition at line 32 of file People.cpp.


Member Function Documentation

void control_lim (  )

limit the people without going off screen

Definition at line 86 of file People.cpp.

void draw ( N5110 lcd,
int  flag 
)

draw it on lcd and alternating type of people when running

Parameters:
lcd
typeflag of people

Definition at line 44 of file People.cpp.

Vector2D get_pos (  )

mutators get the position of people only for test

Returns:
pos(Vector2D)

Definition at line 106 of file People.cpp.

void init (  )

initialize the position of people

Definition at line 37 of file People.cpp.

void set_pos ( Vector2D  p )

accessors set the position of people only for test

Parameters:
pos(Vector2D)

Definition at line 94 of file People.cpp.

void set_velocity ( Direction  d,
float  mag 
)

accessors control the people by Joystick

Parameters:
Direction(Direction)
Mag(float)

Definition at line 100 of file People.cpp.

void update (  )

update the position of people

Definition at line 62 of file People.cpp.