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
Fork of el17dg by
Diff: game/stars.h
- Revision:
- 28:35af3843de8f
- Parent:
- 27:f05f4e738ba9
- Child:
- 29:579e00b7f118
--- a/game/stars.h Mon Apr 08 14:41:57 2019 +0000
+++ b/game/stars.h Wed Apr 10 15:42:10 2019 +0000
@@ -5,6 +5,8 @@
const int max_medium_stars = 5;
const int small_star_speed = 2;
const int medium_star_speed = 6;
+const int stars_delay_max = 5;
+int stars_delay;
class Stars {
public:
@@ -81,5 +83,16 @@
}
}
}
+
+ /** A separate function for delaying the stars spawn time.*/
+ void starsSpawnDelay(){
+ if (stars_delay == stars_delay_max){
+ //This is dealy between stars generation.
+ newSmallStarFlies();
+ newMediumStarFlies();
+ stars_delay = 0;
+ }
+ else {stars_delay += 1;}
+ }
};
#endif
\ No newline at end of file
