intro flappy
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <json11.hpp>
|
||||
|
||||
#include "gif_player.h"
|
||||
#include "flappy.h"
|
||||
|
||||
using namespace json11;
|
||||
|
||||
@@ -311,7 +312,12 @@ void DisplayTask::run() {
|
||||
tft_.fillScreen(TFT_BLACK);
|
||||
tft_.setTextSize(2);
|
||||
tft_.setTextDatum(TC_DATUM);
|
||||
tft_.drawString("Merry Christmas!", center, 10);
|
||||
if (isChristmas()){
|
||||
tft_.drawString("Merry Christmas!", center, 10);
|
||||
}
|
||||
else {
|
||||
tft_.drawString("Credits", center, 10);
|
||||
}
|
||||
tft_.setTextSize(1);
|
||||
tft_.drawString("Designed and handmade", center, 50);
|
||||
tft_.drawString("by Scott Bezek", center, 60);
|
||||
@@ -364,6 +370,28 @@ void DisplayTask::run() {
|
||||
tft_.fillScreen(TFT_BLACK);
|
||||
delay(200);
|
||||
}
|
||||
if (left_button){
|
||||
main_task_.setOtaEnabled(false);
|
||||
state = State::PLAY_FLAPPY;
|
||||
tft_.fillScreen(TFT_BLACK);
|
||||
tft_.setTextSize(2);
|
||||
tft_.setTextDatum(TC_DATUM);
|
||||
tft_.drawString("Lets Flap!", tft_.width()/2, 10);
|
||||
tft_.setTextSize(1);
|
||||
delay(200);
|
||||
|
||||
}
|
||||
break;
|
||||
case State::PLAY_FLAPPY:
|
||||
if (right_button) {
|
||||
// Exit credits
|
||||
main_task_.setOtaEnabled(false);
|
||||
state = State::CHOOSE_GIF;
|
||||
tft_.fillScreen(TFT_BLACK);
|
||||
delay(200);
|
||||
return;
|
||||
}
|
||||
game_loop(left_button);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user