Started with game logic, implemented some draw stuff.
This commit is contained in:
19
src/game.h
19
src/game.h
@@ -1,26 +1,35 @@
|
||||
#ifndef PLAYER_H
|
||||
#define PLAYER_H
|
||||
#ifndef GAME_H
|
||||
#define GAME_H
|
||||
|
||||
#include<stdint.h>
|
||||
#include<stdlib.h>
|
||||
#include"player.h"
|
||||
|
||||
#define PLAYER_COUNT 2
|
||||
#define PLAYER_WIDTH 3
|
||||
#define SPEED_SLOW 10
|
||||
|
||||
typedef struct game_s{
|
||||
//public section
|
||||
|
||||
uint16_t time; // seconds since game start
|
||||
uint8_t winner_id;
|
||||
int8_t winner_id;
|
||||
uint8_t host_id;
|
||||
uint8_t ticks_per_pixel;
|
||||
player_t player[PLAYER_COUNT];
|
||||
|
||||
enum{
|
||||
prestart,
|
||||
running,
|
||||
ended
|
||||
} state;
|
||||
|
||||
|
||||
//private section ahead:
|
||||
uint8_t ticks_leftover;
|
||||
} game_t;
|
||||
|
||||
void game_init(game_t* game);
|
||||
void game_step(game_t* game, uint16_t time_delta);
|
||||
void game_step(game_t* game, uint64_t deltaTime);
|
||||
|
||||
#endif /* PLAYER_H */
|
||||
#endif /* GAME_H */
|
||||
|
||||
Reference in New Issue
Block a user