-
Notifications
You must be signed in to change notification settings - Fork 0
/
events.h
45 lines (33 loc) · 929 Bytes
/
events.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// Created by Avihoo on 13/06/2020.
//
#ifndef TETRIS_EVENTS_H
#define TETRIS_EVENTS_H
#include <SDL.h>
#include "sound.h"
#include "tetris.h"
#include "logic.h"
#include "menu.h"
#include "animation.h"
#include "settings.h"
#include "logic_event_handlers.h"
#define MOVEMENT_KEYBOARD_COOLDOWN (currentSettings.movementKeyboardCooldown)
#define ROTATION_KEYBOARD_COOLDOWN (currentSettings.rotationKeyboardCooldown)
#define DROP_KEYBOARD_COOLDOWN (currentSettings.dropKeyboardCooldown)
#define MILLISECONDS_PER_KEYBOARD_CHECK 1
struct
{
signed int leftCooldown;
signed int rightCooldown;
signed int downCooldown;
signed int dropCooldown;
signed int rotateClockwiseCooldown;
signed int rotateCounterClockwiseCooldown;
} keyboardCooldowns;
void handleGameInput(SDL_Event *e);
void handleTicks();
void handleMenuInput(SDL_Event *e);
void doRawInput();
void initEvents();
int doEvents();
#endif //TETRIS_EVENTS_H