2010-01-15 12:19:54 +00:00
|
|
|
#ifndef PLAYFIELD_H
|
|
|
|
#define PLAYFIELD_H
|
2010-01-15 14:42:46 +00:00
|
|
|
#include "common.h"
|
2010-01-15 12:19:54 +00:00
|
|
|
|
2010-01-19 09:55:28 +00:00
|
|
|
#define BOUNCE_X 0x01
|
|
|
|
#define BOUNCE_Y 0x02
|
|
|
|
#define BOUNCE_UNDEF 0x04
|
|
|
|
|
2010-01-15 12:19:54 +00:00
|
|
|
/* entries for the playing field */
|
|
|
|
enum game_field_t
|
|
|
|
{
|
|
|
|
sp = 0, /* space */
|
|
|
|
b1 = 1, b2 = 2, b3 = 3, /* bricks */
|
2010-01-15 14:42:46 +00:00
|
|
|
bs = 4, /* solid (unbreakable) brick */
|
2010-01-15 12:19:54 +00:00
|
|
|
bl, /* ball */
|
2010-01-15 14:42:46 +00:00
|
|
|
rb /* rebound */
|
2010-01-15 12:19:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* @description draw the current field
|
|
|
|
*/
|
|
|
|
void playfield_draw();
|
|
|
|
|
|
|
|
/* @description set a field with given property.
|
|
|
|
*/
|
|
|
|
void playfield_set (uint8_t in_x, uint8_t in_y, enum game_field_t in_field);
|
|
|
|
|
|
|
|
/* @description Checks if there is an object in the way. If so, it returns 1
|
|
|
|
*/
|
2010-01-19 09:55:28 +00:00
|
|
|
uint8_t check_bounce (int8_t in_x, int8_t in_y);
|
2010-01-15 12:19:54 +00:00
|
|
|
|
|
|
|
#endif /* PLAYFIELD_H */
|