-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcollision.h
More file actions
29 lines (20 loc) · 750 Bytes
/
Copy pathcollision.h
File metadata and controls
29 lines (20 loc) · 750 Bytes
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
29
#ifndef __collision_h__
#define __collision_h__
#include <stdbool.h>
#include "block.h"
// --- //
typedef enum { Clear, Left, Right, Sides,
Bottom, BotLeft, BotRight, Total } Collision;
/* Is the given Block colliding with the world? */
Collision isColliding(block_t* b, Colour* board);
/* In which direction is the Block colliding? */
bool collidingLeft(int* cells, Colour* board);
bool collidingRight(int* cells, Colour* board);
bool collidingDown(int* cells, Colour* board);
/* Is this Collision type any form of `Bottom`? */
bool isBottom(Collision c);
/* Is this Collision type any form of `Right`? */
bool isRight(Collision c);
/* Is this Collision type any form of `Left`? */
bool isLeft(Collision c);
#endif