]> git.lizzy.rs Git - shadowclad.git/blob - src/game/input.c
Add prelude with UNUSED macro
[shadowclad.git] / src / game / input.c
1 #include "input.h"
2
3 #include <GLFW/glfw3.h>
4
5 #include "engine/_prelude.h"
6
7 #include "player.h"
8
9 void keyboardInput(int key, int scancode UNUSED, int action, int mods UNUSED) {
10         switch (key) {
11                 case GLFW_KEY_W:
12                         if (action == GLFW_PRESS) {
13                                 startMovement(DIRECTION_UP);
14                         }
15                         else if (action == GLFW_RELEASE) {
16                                 stopMovement(DIRECTION_UP);
17                         }
18                         break;
19                 case GLFW_KEY_S:
20                         if (action == GLFW_PRESS) {
21                                 startMovement(DIRECTION_DOWN);
22                         }
23                         else if (action == GLFW_RELEASE) {
24                                 stopMovement(DIRECTION_DOWN);
25                         }
26                         break;
27                 case GLFW_KEY_A:
28                         if (action == GLFW_PRESS) {
29                                 startMovement(DIRECTION_LEFT);
30                         }
31                         else if (action == GLFW_RELEASE) {
32                                 stopMovement(DIRECTION_LEFT);
33                         }
34                         break;
35                 case GLFW_KEY_D:
36                         if (action == GLFW_PRESS) {
37                                 startMovement(DIRECTION_RIGHT);
38                         }
39                         else if (action == GLFW_RELEASE) {
40                                 stopMovement(DIRECTION_RIGHT);
41                         }
42                         break;
43                 default:
44                         break;
45         }
46 }