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-02
- Revision:
- 7:82079de8bcd6
- Parent:
- 6:33bdb54c2c88
- Child:
- 8:09eb8fe2bb20
File content as of revision 7:82079de8bcd6:
#ifndef FUNCTIONS_H #define FUNCTIONS_H //includes #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "Objects.h" struct Ball{ int movement_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]; }; struct Ball_linear{ int movement_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]; }; 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 private: int _initial_radiuss;//holds the intial ball radiuss which is 2 }; #endif