Implemented two players on single host, changed io processing to interrupt.
This commit is contained in:
16
src/game.h
16
src/game.h
@@ -5,16 +5,23 @@
|
||||
#include<stdlib.h>
|
||||
#include"player.h"
|
||||
|
||||
#define PLAYER_COUNT 2
|
||||
#define PLAYER_WIDTH 3
|
||||
#define SPEED_SLOW 10
|
||||
#define PLAYER_COUNT 2
|
||||
#define PLAYER_WIDTH 0 // Don't change
|
||||
#define SPEED_SLOW 10
|
||||
#define SPEED_FAST 1
|
||||
#define SPEED_DEFAULT (SPEED_SLOW)
|
||||
|
||||
#define BTN_START 0
|
||||
#define BTN_PLAYER_1_LEFT 3
|
||||
#define BTN_PLAYER_1_RIGHT 2
|
||||
#define BTN_PLAYER_2_LEFT 1
|
||||
#define BTN_PLAYER_2_RIGHT 0
|
||||
|
||||
typedef struct game_s{
|
||||
//public section
|
||||
|
||||
uint16_t time; // seconds since game start
|
||||
int8_t winner_id;
|
||||
uint8_t host_id;
|
||||
uint8_t ticks_per_pixel;
|
||||
player_t player[PLAYER_COUNT];
|
||||
|
||||
@@ -24,7 +31,6 @@ typedef struct game_s{
|
||||
ended
|
||||
} state;
|
||||
|
||||
|
||||
//private section ahead:
|
||||
uint8_t ticks_leftover;
|
||||
} game_t;
|
||||
|
||||
Reference in New Issue
Block a user