borgware-2d/games/breakout/playfield.h

54 lines
1.5 KiB
C
Raw Normal View History

2010-01-21 14:45:16 +00:00
/*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place - Suite 330, Boston, MA 02111-1307 USA.
*
* Author & Copyright (C) 2010: Soeren Heisrath (forename@surename.org)
*
*/
2010-01-21 21:26:30 +00:00
#include "common.h"
#ifndef PLAYFIELD_H
#define PLAYFIELD_H
2010-01-21 13:40:40 +00:00
#define BOUNCE_NONE 0x00
#define BOUNCE_X 0x01
#define BOUNCE_Y 0x02
#define BOUNCE_UNDEF 0x04
#define BOUNCE_BRICK 0x08
#define BOUNCE_REBOUND 0x10
2010-01-19 09:55:28 +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 */
bl, /* ball */
2010-01-15 14:42:46 +00:00
rb /* rebound */
};
/* @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);
#endif /* PLAYFIELD_H */