Subversion Repositories Code-Repo

Rev

Rev 278 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
241 Kevin 1
#ifndef TRON_H
2
#define	TRON_H
3
 
4
#include "CUBE.h"
5
 
278 Kevin 6
#define TRON_MAX_PLAYERS    4
7
#define TRON_COLLISION      WHITE
8
#define TRON_COLLISION_2    ORANGE
9
#define TRON_DELAY          800
241 Kevin 10
 
11
typedef struct {
278 Kevin 12
    uint8_t x;
13
    uint8_t y;
14
    uint8_t z;
241 Kevin 15
} TRON_POINT;
16
 
278 Kevin 17
typedef struct {
18
    uint8_t Color_Head_R[TRON_MAX_PLAYERS];
19
    uint8_t Color_Head_G[TRON_MAX_PLAYERS];
20
    uint8_t Color_Head_B[TRON_MAX_PLAYERS];
241 Kevin 21
 
278 Kevin 22
    uint8_t Color_Body_R[TRON_MAX_PLAYERS];
23
    uint8_t Color_Body_G[TRON_MAX_PLAYERS];
24
    uint8_t Color_Body_B[TRON_MAX_PLAYERS];
241 Kevin 25
 
278 Kevin 26
    TRON_POINT body[TRON_MAX_PLAYERS][CUBE_PIXELS];
27
    TRON_POINT direction[TRON_MAX_PLAYERS];
28
    uint8_t last_direction[TRON_MAX_PLAYERS];
29
    uint8_t dead[TRON_MAX_PLAYERS];
30
    uint32_t length[TRON_MAX_PLAYERS];
241 Kevin 31
 
278 Kevin 32
    uint8_t players;
33
    uint8_t players_alive;
241 Kevin 34
    uint32_t delay;
35
} TRON_DATA;
36
 
37
void Tron_Init(TRON_DATA *data);
38
void Tron_Main(void);
278 Kevin 39
void Tron_Update_Direction(uint8_t controller, CTRL_BTN_STATUS value);
241 Kevin 40
void Tron_Update_Frame(void);
41
 
42
#endif	/* TRON_H */
43