Arturs Kozlovskis 201253737

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Functions Class Reference

Functions Class Reference

Functions class. More...

#include <Functions.h>

Public Member Functions

 Functions ()
 Constructor.
void ball_position_parabolic (N5110 &lcd, Objects &objects, Gamepad &pad, int c)
 Draw parabolic ball.
void ball_position_linear (N5110 &lcd, Objects &objects, Gamepad &pad, int c)
 Draw linear ball.
void collision_checker (N5110 &lcd, Objects &objects, Gamepad &pad)
 Check for collisions.
void ball1_finder (int x, int y)
 Find the collided ball(linear)
void ball_finder (int x, int y)
 Find the collided ball(parabolic)
bool cannon_smash (N5110 &lcd, Objects &objects)
 Check if cannon has been hit.
int random (Gamepad &pad)
 Generate a random value.
void ball_creater_linear (N5110 &lcd, Objects &objects, Gamepad &pad)
 Govern the linear ball movement and creation.
void ball_creater_parabolic (N5110 &lcd, Objects &objects, Gamepad &pad)
 Govern the parabolic ball movement and creation.
int round (float number)
 Round a value.
int get_score ()
 Get score.

Detailed Description

Functions class.

Contains the game engine

Author:
Arturs Kozlovskis
Date:
April,2020

Definition at line 39 of file Functions.h.


Constructor & Destructor Documentation

Functions (  )

Constructor.

Definition at line 21 of file Functions.cpp.


Member Function Documentation

void ball1_finder ( int  x,
int  y 
)

Find the collided ball(linear)

Parameters:
xvalue of pixel that caused the collision
yvalue of pixel that caused the collision

Definition at line 162 of file Functions.cpp.

void ball_creater_linear ( N5110 lcd,
Objects objects,
Gamepad pad 
)

Govern the linear ball movement and creation.

Parameters:
N5110class object
Objectsclass object
Gamepadclass object

Definition at line 349 of file Functions.cpp.

void ball_creater_parabolic ( N5110 lcd,
Objects objects,
Gamepad pad 
)

Govern the parabolic ball movement and creation.

Parameters:
N5110class object
Objectsclass object
Gamepadclass object

Definition at line 423 of file Functions.cpp.

void ball_finder ( int  x,
int  y 
)

Find the collided ball(parabolic)

Parameters:
xvalue of pixel that caused the collision
yvalue of pixel that caused the collision

Definition at line 187 of file Functions.cpp.

void ball_position_linear ( N5110 lcd,
Objects objects,
Gamepad pad,
int  c 
)

Draw linear ball.

Parameters:
N5110class object
Objectsclass object
Gamepadclass object
ctell the function which ball to chose from(int)

Definition at line 124 of file Functions.cpp.

void ball_position_parabolic ( N5110 lcd,
Objects objects,
Gamepad pad,
int  c 
)

Draw parabolic ball.

Parameters:
N5110class object
Objectsclass object
Gamepadclass object
ctell the function which ball to chose from(int)

Definition at line 54 of file Functions.cpp.

bool cannon_smash ( N5110 lcd,
Objects objects 
)

Check if cannon has been hit.

Parameters:
N5110class object
Objectsclass object
Returns:
bool if collision has happened or not(bool)

Definition at line 212 of file Functions.cpp.

void collision_checker ( N5110 lcd,
Objects objects,
Gamepad pad 
)

Check for collisions.

Parameters:
N5110class object
Objectsclass object
Gamepadclass object

Definition at line 141 of file Functions.cpp.

int get_score (  )

Get score.

Returns:
the players current score

Definition at line 466 of file Functions.cpp.

int random ( Gamepad pad )

Generate a random value.

Parameters:
Gamepadclass object
Returns:
a random value in range of 0 to 100(int)

Definition at line 293 of file Functions.cpp.

int round ( float  number )

Round a value.

Parameters:
Numbervalue that needs rounding
Returns:
a rounded value of passed value

Definition at line 453 of file Functions.cpp.