bar limit
This commit is contained in:
parent
e51ab673c5
commit
01a6c5e4ff
1 changed files with 7 additions and 3 deletions
|
|
@ -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();
|
||||||
kubo_wall_add_vertex(current_wall, new_pos);
|
if (new_pos.y < bar_limit) {
|
||||||
current_wall->state = KUBO_WALL_DRAWING;
|
kubo_wall_add_vertex(current_wall, new_pos);
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue