444444444444

Dependencies:   mbed CXK

Embed: (wiki syntax)

« Back to documentation index

Ball Class Reference

Ball Class Reference

Ball Class. More...

#include <Ball.h>

Public Member Functions

 Ball ()
 Constructor.
 ~Ball ()
 Destrctor.
void init (int size, int speed, int direction)
 Set the ball init.
void draw (N5110 &lcd)
 Set the balldraw @ details lcd.drawCircle(_x,_y,_size,FILL_BLACK); @ param value that updated (_x,_y, _size)
void update ()
 Set the update.
void set_velocity (Vector2D v)
 accessors and mutators
void set_pos (Vector2D p)
 Set the balldraw @ details set the value of position of LCD cooresponding p= {x,y}; @ param value that updated (p) @ returns p.

Detailed Description

Ball Class.

Controls the ball in Ubeautiful CXK game

Author:
Zhang Xinyu EE of SWJTU &leeds joint school
Date:
MAY 2019

Definition at line 16 of file Ball.h.


Constructor & Destructor Documentation

Ball (  )

Constructor.

Definition at line 3 of file Ball.cpp.

~Ball (  )

Destrctor.

Definition at line 8 of file Ball.cpp.


Member Function Documentation

void draw ( N5110 lcd )

Set the balldraw @ details lcd.drawCircle(_x,_y,_size,FILL_BLACK); @ param value that updated (_x,_y, _size)

Definition at line 41 of file Ball.cpp.

void init ( int  size,
int  speed,
int  direction 
)

Set the ball init.

Parameters:
thevalue of init (size,speed, direction)

Definition at line 13 of file Ball.cpp.

void set_pos ( Vector2D  p )

Set the balldraw @ details set the value of position of LCD cooresponding p= {x,y}; @ param value that updated (p) @ returns p.

Definition at line 70 of file Ball.cpp.

void set_velocity ( Vector2D  v )

accessors and mutators

Set the balldraw @ details set the value of veocity LCD cooresponding v = {_velocity.x,_velocity.y}; @ param value that updated (v) @ returns v

Definition at line 52 of file Ball.cpp.

void update (  )

Set the update.

updated the _x,_y value by speed means move the ball

Definition at line 46 of file Ball.cpp.