-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathPagonGameDev_GameLoop.h
More file actions
37 lines (30 loc) · 854 Bytes
/
Copy pathPagonGameDev_GameLoop.h
File metadata and controls
37 lines (30 loc) · 854 Bytes
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
//================================================
// Dev by : Pagon Game Dev
// PagonGameDev@gmail.com
//================================================
#ifndef PagonGameDev_GameLoop_h
#define PagonGameDev_GameLoop_h
#include "Arduino.h"
class GameInterval
{
public:
GameInterval(int iInputInterval, void (funcInterval)());
void update();
float DeltaTime;
private:
int iMillisInterval;
int iMillisDelayTime;
int iMillisIntervalDelayTime;
unsigned long lMillisPrevious;
unsigned long lMillisCurrent;
void(*functionInterval)();
};
class GameInput
{
public:
GameInput();
static bool getKey(int iPinInput, bool isTrueState);
static bool getKeyDown(int iPinInput, bool isTrueState, bool& bInputBuffRead);
static bool getKeyUp(int iPinInput, bool isTrueState, bool& bInputBuffRead);
};
#endif