Initial Commit
This commit is contained in:
commit
5314a9d5c5
308 changed files with 190647 additions and 0 deletions
25
include/grid.h
Normal file
25
include/grid.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef __GRID_H
|
||||
#define __GRID_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#define GRID_WIDTH 10
|
||||
#define GRID_HEIGHT 16
|
||||
|
||||
#define grid_cell(grid, x, y) ((grid)[(x) + ((y) * GRID_WIDTH)])
|
||||
|
||||
typedef uint8_t grid_t[GRID_HEIGHT * GRID_WIDTH];
|
||||
|
||||
void grid_init(grid_t grid);
|
||||
|
||||
int grid_check_collision(grid_t grid, int8_t x, int8_t y);
|
||||
|
||||
// clears all full rows on the board.
|
||||
// Returns the number of rows cleared.
|
||||
uint32_t grid_clear_full_rows(grid_t grid);
|
||||
|
||||
// Clears the row and moves all rows above down one step.
|
||||
void grid_clear_row(grid_t grid, uint8_t row);
|
||||
|
||||
#endif /* __GRID_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue