Separated backend.c into backend graphics and text .c
[cantaveria.git] / game.h
blob9e6b15f5a2dcad4fa749e3c0fa70bca01bcd43dc
1 /*
2 Cantaveria - action adventure platform game
3 Copyright (C) 2009 Evan Rinehart
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to
18 The Free Software Foundation, Inc.
19 51 Franklin Street, Fifth Floor
20 Boston, MA 02110-1301, USA
23 struct handler {
24 void (*keydown)(int key);
25 void (*keyup)(int key);
26 void (*joymovex)(int joy, int x);
27 void (*joymovey)(int joy, int y);
28 void (*joypress)(int joy, int button);
29 void (*joyrelease)(int joy, int button);
32 struct game {
33 struct handler handler;
34 void (*update)();
35 int end;
39 struct tile {
40 unsigned char type;
41 unsigned char id;
44 struct screen {
45 struct tile tiles[20][15];
46 int flags;
49 typedef struct {
50 struct screen* screens;
51 int tileset;
52 /*background*/
53 int x,y,w,h;
54 } zone;
57 extern struct game game;
58 extern zone* zones[32];
60 enum {
61 SPRITE_ONE,
62 SPRITE_TWO,
63 SPRITE_THREE,
64 SPRITE_FOUR
68 void load_game();