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.
Diff: main.cpp
- Revision:
- 13:81573be8fac6
- Parent:
- 12:d3eef5ea3f43
- Child:
- 14:a57a40ff9430
--- a/main.cpp Mon May 07 18:06:50 2018 +0000
+++ b/main.cpp Mon May 07 19:41:09 2018 +0000
@@ -128,19 +128,18 @@
{
int _dif = mainMenu.getDif();
- if (_dif == 1) {
+ if (_dif == 1) { //Low difficulty
return 1.0f/4;
- } else if (_dif == 2) {
+ } else if (_dif == 2) { //Medium difficulty
return 1.0f/8;
- } else if (_dif == 3) {
+ } else if (_dif == 3) { //Hard difficulty
return 1.0f/12;
- } else if (_dif == 4) {
- int _delta = gameEngine.getScore();
- if (_delta < 38) {
- return ((1.0f/(_delta/2)) + 6);
+ } else { //Adaptive difficulty
+ float _delta = gameEngine.getScore();
+ if (_delta < 25) { //Limits FPS to 25
+ return ((1.0f/(_delta + 1)));
} else {
return (1.0f/25);
}
}
- return 1.0f;
}