mirror of
https://github.com/thepigeongenerator/tetris_clone.git
synced 2025-12-17 14:05:45 +01:00
Initial commit
This commit is contained in:
11
src/game/game.c
Normal file
11
src/game/game.c
Normal file
@@ -0,0 +1,11 @@
|
||||
#include "game.h"
|
||||
|
||||
#include "../main.h"
|
||||
|
||||
|
||||
// called every time the game's state is updated
|
||||
void game_update(GameData game_data, const Uint8* keys) {
|
||||
if (keys[SDL_SCANCODE_ESCAPE]) {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
9
src/game/game.h
Normal file
9
src/game/game.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
// stores the data used in the game
|
||||
typedef struct {
|
||||
} GameData;
|
||||
|
||||
// updates the game's state
|
||||
void game_update(GameData game_data, const Uint8* keys);
|
||||
Reference in New Issue
Block a user