diff -r 3b78ad115ccd -r 5ed38debd4a7 test/snake/snake.c --- a/test/snake/snake.c Sat Aug 02 13:07:28 2025 +0200 +++ b/test/snake/snake.c Sat Aug 02 13:20:51 2025 +0200 @@ -67,8 +67,8 @@ bool reset_position; } Player; -static const unsigned game_field_size = 16; -static const unsigned game_field_tile_size = 64; +static const unsigned game_field_size = 32; +static const unsigned game_field_tile_size = 32; static void globals_init(void) { asc_transform_identity(rotations[MOVE_UP]); @@ -125,11 +125,8 @@ // TODO: this should be replaced with some sort of UI layout manager AscSceneNode *node = behavior->node; if (asc_test_flag(node->flags, ASC_SCENE_NODE_GRAPHICS_UPDATED) || asc_active_window->resized) { - asc_vec2u bottom_right = asc_active_window->dimensions; - asc_vec2u text_size = ((AscText*)node)->dimension; - asc_scene_node_set_position2f(node, ASC_VEC2F( - (int) bottom_right.x - (int) text_size.width - 10, - (int) bottom_right.y - (int) text_size.height - 10 + asc_scene_node_set_position2f(node, ASC_VEC2F(10, + asc_active_window->dimensions.y - ((AscText*)node)->dimension.height - 10 )); } } @@ -145,17 +142,6 @@ asc_ui_add_node(node); } -static void score_counter_create(void) { - AscSceneNode *node = asc_text( - .name = "Score Counter", - .x = 10, .y = 10, - .text = "Score: 0", - .color = ASC_RGB(0, 255, 0), - .font = asc_font(ASC_FONT_BOLD, 16), - ); - asc_ui_add_node(node); -} - static void player_move(AscBehavior *behavior) { AscSceneNode *node = behavior->node; Player *player = node->user_data; @@ -227,7 +213,7 @@ asc_scene_add_node(MAIN_SCENE, sprite); Player *player = asc_scene_node_allocate_data(sprite, sizeof(Player)); player_position(player, 12, 8); - player->speed = 2.f; // start with 2 tiles/sec + player->speed = 3.f; // start with 3 tiles/sec asc_behavior_add(sprite, player_move); return player; } @@ -238,11 +224,11 @@ for (unsigned x = 1; x <= game_field_size; x++) { for (unsigned y = 1; y <= game_field_size; y++) { AscSceneNode *tile = asc_rectangle( - .x = x*game_field_tile_size, .y = y*game_field_tile_size, .filled = true, .thickness = 1, + .x = x*game_field_tile_size, .y = y*game_field_tile_size, .filled = true, .thickness = 2, .origin_x = game_field_tile_size / 2, .origin_y = game_field_tile_size / 2, .width = game_field_tile_size, .height = game_field_tile_size, - .color = ASC_RGB(0, 128, 255), - .border_color = ASC_RGB(64, 196, 255), + .color = ASC_RGB(16, 50, 160), + .border_color = ASC_RGB(20, 84, 128), ); asc_scene_node_link(gamefield, tile); } @@ -323,7 +309,7 @@ (game_field_size+1)*game_field_tile_size ), .viewport_clear = true, - .clear_color = ASC_RGB(0, 128, 90), + .clear_color = ASC_RGB(0, 32, 16), .viewport_update_func = main_scene_viewport_update ); @@ -335,7 +321,6 @@ // create UI elements fps_counter_create(); - score_counter_create(); // create spaceship Player *spaceship = player_create();