enable restart current game

This commit is contained in:
Sylvain PILLOT 2023-09-10 18:49:29 +02:00
parent 8ec39f68b8
commit fcc7a81d2d
1 changed files with 12 additions and 3 deletions

View File

@ -51,7 +51,7 @@
bool exitToOS = false;
uint8_t texttodraw = 1;
uint8_t CurrentSequence = 0;
float elapsedTime = 0.0f;
float realDeltaTime = 0.0f;
@ -210,8 +210,8 @@ static void render(void) {
#if (DEBUG_MODE)
/* debug info (FPS and current game duration )*/
azrp_draw_text(150, 0, "FPS = %.0f - Time = %.2 f" ,
(float)(1.0f / realDeltaTime));
azrp_draw_text(150, 0, "FPS = %.0f - DeltaTime = %.3f ms" ,
(float)(1.0f / realDeltaTime), realDeltaTime * 1000.0f );
#endif
/* score */
@ -252,22 +252,31 @@ static void get_inputs(float dt) {
if (MyKeyboard.IsKeyPressed(MYKEY_OPTN) &&
MyKeyboard.IsKeyHoldPressed(MYKEY_F1)) {
SetupScene(0);
CurrentSequence = 0;
}
if (MyKeyboard.IsKeyPressed(MYKEY_OPTN) &&
MyKeyboard.IsKeyHoldPressed(MYKEY_F2)) {
SetupScene(1);
CurrentSequence = 1;
}
if (MyKeyboard.IsKeyPressed(MYKEY_OPTN) &&
MyKeyboard.IsKeyHoldPressed(MYKEY_F3)) {
SetupScene(2);
CurrentSequence = 2;
}
if (MyKeyboard.IsKeyPressed(MYKEY_OPTN) &&
MyKeyboard.IsKeyHoldPressed(MYKEY_F4)) {
SetupScene(3);
CurrentSequence = 3;
}
if (MyKeyboard.IsKeyPressed(MYKEY_OPTN) &&
MyKeyboard.IsKeyHoldPressed(MYKEY_F5)) {
SetupScene(4);
CurrentSequence = 4;
}
if (MyKeyboard.IsKeyHoldPressed(MYKEY_EXE)) {
SetupScene(CurrentSequence);
}
// TODO : to be changed to remove cumulatedTime