Implemented two players on single host, changed io processing to interrupt.

This commit is contained in:
id101010
2016-01-26 12:25:24 +01:00
parent 91d6b2af96
commit 77e64dacf7
8 changed files with 166 additions and 133 deletions

View File

@@ -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;