removed preset initialization functions
parent
ec50000130
commit
14a81b0f2a
31
src/game.c
31
src/game.c
|
@ -7,35 +7,8 @@
|
||||||
#include "SDL2/SDL_mouse.h"
|
#include "SDL2/SDL_mouse.h"
|
||||||
#include "SDL2/SDL_scancode.h"
|
#include "SDL2/SDL_scancode.h"
|
||||||
|
|
||||||
void on_quit_key(int down) {
|
|
||||||
// Q is pressed or released
|
|
||||||
if(down) {
|
|
||||||
// stop running when Q is pressed
|
|
||||||
g_context.running = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void on_horizontal(int axis) {
|
|
||||||
// when A or D is pressed or released
|
|
||||||
}
|
|
||||||
|
|
||||||
void on_vertical(int axis) {
|
|
||||||
// W or S is pressed or released
|
|
||||||
}
|
|
||||||
|
|
||||||
void on_click(int down) {
|
|
||||||
// when the left mouse button is pressed down
|
|
||||||
// float mouse_x, mouse_y;
|
|
||||||
// mouse_world_position(&mouse_x, &mouse_y);
|
|
||||||
}
|
|
||||||
|
|
||||||
void start_game() {
|
void start_game() {
|
||||||
// called when the game is done initializing the backend and ready to start
|
// called when the game is done initializing the backend and ready to start
|
||||||
g_active_view.width = 21;
|
|
||||||
add_key_listener(SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_Q, &on_quit_key);
|
|
||||||
add_key_listener(SDL_SCANCODE_S, SDL_SCANCODE_W, &on_horizontal);
|
|
||||||
add_key_listener(SDL_SCANCODE_A, SDL_SCANCODE_D, &on_vertical);
|
|
||||||
add_mouse_button_listener(SDL_BUTTON_LMASK, &on_click);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_game() {
|
void update_game() {
|
||||||
|
@ -48,4 +21,6 @@ void update_ui() {
|
||||||
// render calls made in this function will be in *screen* space
|
// render calls made in this function will be in *screen* space
|
||||||
}
|
}
|
||||||
|
|
||||||
void game_exit() {}
|
void game_exit() {
|
||||||
|
// called when the game shuts down
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue