mouse button rotation + minor fixes

This commit is contained in:
shweet 2023-08-08 02:22:51 -04:00
parent d5d5b3530d
commit 8ed66cfba8
4 changed files with 29 additions and 6 deletions

View File

@ -24,6 +24,7 @@ find_package(SDL2_mixer REQUIRED)
find_package(SDL2_ttf REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(GLEW REQUIRED)
find_package(OpenGL REQUIRED)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_C_FLAGS "-O2 -Wno-discarded-qualifiers -Wno-pointer-arith -Wno-unused-variable -Wno-unused-parameter -Wall -Wextra -pedantic -g")
@ -32,7 +33,7 @@ else()
set(CMAKE_C_FLAGS "-O2 -Wno-discarded-qualifiers -Wno-pointer-arith -Wno-unused-variable -Wno-unused-parameter -Wall -Wextra -pedantic")
endif()
target_link_libraries(${PROJECT_NAME} m SDL2::SDL2 SDL2_mixer::SDL2_mixer SDL2_ttf::SDL2_ttf SDL2_image::SDL2_image GLEW::GLEW)
target_link_libraries(${PROJECT_NAME} m SDL2::SDL2 SDL2_mixer::SDL2_mixer SDL2_ttf::SDL2_ttf SDL2_image::SDL2_image GLEW::GLEW OpenGL::GL)
if (WIN32)
set(CMAKE_C_FLAGS "-mwindows ${CMAKE_C_FLAGS}")

View File

@ -25,14 +25,16 @@ update_f(struct CRotation* self)
if
(
keyboard_held(&game.keyboard, KEYBOARD_LEFT) ||
keyboard_held(&game.keyboard, KEYBOARD_A)
keyboard_held(&game.keyboard, KEYBOARD_A) ||
mouse_held(&game.mouse, MOUSE_LEFT)
)
self->velocity += self->speed;
if
(
keyboard_held(&game.keyboard, KEYBOARD_RIGHT) ||
keyboard_held(&game.keyboard, KEYBOARD_D)
keyboard_held(&game.keyboard, KEYBOARD_D) ||
mouse_held(&game.mouse, MOUSE_RIGHT)
)
self->velocity -= self->speed;

View File

@ -428,10 +428,7 @@ void
play_update_f(struct Play* self)
{
if (keyboard_press(&game.keyboard, KEYBOARD_P))
{
game.isPaused = !game.isPaused;
printf("???\n");
}
if (game.isPaused)
return;

23
src/h Normal file
View File

@ -0,0 +1,23 @@
[?1049h[?1h=]11;?[?2004h[?u[?25h[?25l
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
(BGAME 0,0-1 All[2 q[2 q[?1002h[?1006h[?25h[?25l[?1004h[?25h