bar limit

This commit is contained in:
Luka Jankovic 2025-06-24 22:04:14 +02:00
parent e51ab673c5
commit 01a6c5e4ff

View file

@ -51,6 +51,8 @@ void kubo_window_render(struct kubo_context *context) {
} }
void kubo_window_input(struct kubo_context *context) { void kubo_window_input(struct kubo_context *context) {
int bar_limit = GetScreenHeight() - KUBO_BAR_HEIGHT;
if (IsKeyPressed(KEY_Q)) { if (IsKeyPressed(KEY_Q)) {
context->exit_pending = true; context->exit_pending = true;
} }
@ -59,8 +61,10 @@ void kubo_window_input(struct kubo_context *context) {
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) { if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) {
Vector2 new_pos = GetMousePosition(); Vector2 new_pos = GetMousePosition();
if (new_pos.y < bar_limit) {
kubo_wall_add_vertex(current_wall, new_pos); kubo_wall_add_vertex(current_wall, new_pos);
current_wall->state = KUBO_WALL_DRAWING; current_wall->state = KUBO_WALL_DRAWING;
}
} else if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT)) { } else if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT)) {
current_wall->state = KUBO_WALL_DONE; current_wall->state = KUBO_WALL_DONE;
} }