Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Spooks4576 committed Oct 31, 2024
1 parent b431446 commit fcb8386
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main/managers/ap_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ static esp_err_t api_settings_handler(httpd_req_t* req) {
}

cJSON* flappy_ghost_name = cJSON_GetObjectItem(root, "flappy_ghost_name");
if (printer_alignment) {
if (flappy_ghost_name) {
settings_set_flappy_ghost_name(settings, flappy_ghost_name->valuestring);
}

Expand Down
11 changes: 7 additions & 4 deletions main/managers/views/flappy_ghost.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "esp_wifi.h" // For internet connectivity check
#include "esp_http_client.h" // For HTTP requests
#include "managers/settings_manager.h"
#include "esp_crt_bundle.h"

lv_obj_t *name_text_area = NULL;
lv_obj_t *keyboard = NULL;
Expand Down Expand Up @@ -106,6 +107,9 @@ void submit_score_to_api(const char *name, int score) {

esp_http_client_config_t config = {
.url = WebHookURL,
.timeout_ms = 5000,
.crt_bundle_attach = esp_crt_bundle_attach,
.transport_type = HTTP_TRANSPORT_OVER_SSL,
};
esp_http_client_handle_t client = esp_http_client_init(&config);

Expand Down Expand Up @@ -282,10 +286,9 @@ void flappy_bird_game_loop(lv_timer_t *timer) {
lv_img_set_angle(bird, angle * 10);

// Bypass checks for smaller screens
if (LV_VER_RES > 135) {
if ((bird_y_position + lv_obj_get_height(bird)) >= (LV_VER_RES - 40) || bird_y_position <= 0) {
flappy_bird_game_over();
}

if ((bird_y_position + lv_obj_get_height(bird)) >= (LV_VER_RES - 40) || bird_y_position <= 0) {
flappy_bird_game_over();
}

// Update each pipe set
Expand Down

0 comments on commit fcb8386

Please sign in to comment.