Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
My_game_clases/Functions.h
- Committer:
- thestudent
- Date:
- 2020-04-10
- Revision:
- 9:4b11ee1155ad
- Parent:
- 8:09eb8fe2bb20
- Child:
- 10:f5b920a6a71a
File content as of revision 9:4b11ee1155ad:
#ifndef FUNCTIONS_H #define FUNCTIONS_H //includes #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "Objects.h" struct Ball{ int ball_x_pos[10]; // moves the ball across the screen float movement_y_counter[10]; //sets the gravity with which the ball will fall int time[10];//the time as in the y postion of the ball which will governed by equation y = _y_initial + _movement_y_counter * _time^2 int ball_y_pos[10];//balls_y_position int time_incrementer[10];//increments time value int ball_x_incrementer[10];//increments movement_x_pos value int delta_r[10]; // defines the ball size int initial_starting_pos[10]; int time_limit[10];// restrict time to 6 or 5 depending on the balls size }; struct Ball_linear{ int ball_x_pos[10]; // moves the ball across the screen int movement_y_counter[10]; //sets the gravity with which the ball will fall int time[10];//the time as in the y postion of the ball which will governed by equation y = _y_initial + _movement_y_counter * _time^2 int ball_y_pos[10];//balls_y_position int time_incrementer[10];//increments time value int ball_x_incrementer[10];//increments movement_x_pos value int delta_r[10]; // defines the ball size int initial_starting_pos[10]; int time_limit[10];// restrict time to 6 or 5 depending on the balls size }; class Functions { public: Functions(); void ball_position_parabolic( N5110 &lcd, Objects &objects,int c);//governs the balls movement in a parabolic way void ball_position_linear (N5110 &lcd, Objects &objects,int c);//governs the balls movement in a linear way void collision_checker(N5110 &lcd,Objects &objects);//checks if the shot has coma into contact with the ball void ball1_finder(int x, int y);//checks which ball has been hit by a shot and then decreses it size void ball_finder(int x, int y);//checks which ball has been hit by a shot and then decreses it size private: int _initial_radiuss;//holds the intial ball radiuss which is 2 }; #endif