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.
Dependencies: mbed
Diff: shot/shot.h
- Revision:
- 6:dce38fe4e092
- Parent:
- 5:6774b7272e85
- Child:
- 7:c49f3d3b672f
--- a/shot/shot.h Tue Apr 14 06:39:11 2020 +0000 +++ b/shot/shot.h Tue Apr 28 15:54:41 2020 +0000 @@ -5,12 +5,18 @@ #include "Gamepad.h" #include "N5110.h" #include <vector> +#include <time.h> +#include <stdlib.h> /** shot class @set several kinds of shot and come from all around @author Zeyu Feng @13 April 2020 */ + + + + struct shot_posandtype{ int x; int y; @@ -26,25 +32,31 @@ //destructor ~shot(); - void init(N5110 &lcd); + void init(); - int rand_dir();//random direction of shot + void init_pos(shot_posandtype* i); + + //int rand_dir();random direction of shot int rand_type();//give a random number from 0 - 3 void gen_shot();//3 types direction - void update(N5110 &lcd); + void update(); + + void draw(N5110 &lcd); + void delete_shot(); + + int _size; private: std::vector<shot_posandtype> _p; - }; #endif