-
Notifications
You must be signed in to change notification settings - Fork 4
/
board.h
28 lines (20 loc) · 802 Bytes
/
board.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef BOARD_H
#define BOARD_H
#include "constants.h"
#include "gamemath.h"
#include "pieces.h"
extern u8 piecesActive[MAX_NUMBER_OF_INGAME_PIECES];
extern Pos2 piecePositions[MAX_NUMBER_OF_INGAME_PIECES];
extern Vec2 pieceViewPos[MAX_NUMBER_OF_INGAME_PIECES];
extern u8 pieceIsLerping[MAX_NUMBER_OF_INGAME_PIECES];
extern Vec2 oldPiecePos[MAX_NUMBER_OF_INGAME_PIECES];
extern float pieceLerpValue[MAX_NUMBER_OF_INGAME_PIECES];
extern PieceInfo pieceData[MAX_NUMBER_OF_INGAME_PIECES];
void initPieceStates();
int tileIsLight(int x, int y);
int tileIsDark(int x, int y);
// returns -1 if empty, otherwise the index of the occupying piece
int isSpaceOccupied(int x, int y);
int isSpaceOccupiedButIgnoreMovingPieces(int x, int y);
void boardPosToLetter(const Pos2* spot, char* x, char* y);
#endif