diff --git a/kubo_window.c b/kubo_window.c index 8b79f77..511d348 100644 --- a/kubo_window.c +++ b/kubo_window.c @@ -41,7 +41,7 @@ void kubo_window_render(struct kubo_context *context) { for (int i = 0; i < context->walls.count; i++) { struct kubo_wall *wall = kubo_wall_arr_get(&context->walls, i); assert(wall != NULL); - + kubo_wall_render(wall); } @@ -51,6 +51,8 @@ void kubo_window_render(struct kubo_context *context) { } void kubo_window_input(struct kubo_context *context) { + int bar_limit = GetScreenHeight() - KUBO_BAR_HEIGHT; + if (IsKeyPressed(KEY_Q)) { context->exit_pending = true; } @@ -59,8 +61,10 @@ void kubo_window_input(struct kubo_context *context) { if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) { Vector2 new_pos = GetMousePosition(); - kubo_wall_add_vertex(current_wall, new_pos); - current_wall->state = KUBO_WALL_DRAWING; + if (new_pos.y < bar_limit) { + kubo_wall_add_vertex(current_wall, new_pos); + current_wall->state = KUBO_WALL_DRAWING; + } } else if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT)) { current_wall->state = KUBO_WALL_DONE; }