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
38 void edit_keydown(int key
){
39 printf("you pressed key %d\n",key
);
40 if(key
== ESCAPE_KEY
){
45 void edit_keyup(int key
){
46 printf("you release key %d\n",key
);
49 void edit_joymovex(int joy
, int x
){
50 printf("you moved joystick %d x axis to %d\n",joy
,x
);
53 void edit_joymovey(int joy
, int y
){
54 printf("you moved joystick %d y axis to %d\n",joy
,y
);
57 void edit_joypress(int joy
, int button
){
58 printf("you pressed joystick %d button %d\n",joy
,button
);
61 void edit_joyrelease(int joy
, int button
){
62 printf("you released joystick %d button %d\n",joy
,button
);
65 struct handler edit_handler
= {
66 edit_keydown
, edit_keyup
, edit_joymovex
,
67 edit_joymovey
, edit_joypress
, edit_joyrelease
70 void main_init(int argc
, char* argv
[]){
71 backend_init(argc
, argv
);
76 game
.handler
= edit_handler
;
80 char** list
= loader_readdir("zones");
81 for(int i
=0; list
[i
]; i
++){
82 printf("loading zone \"%s\"\n",list
[i
]);
85 loader_freedirlist(list
);
106 for(int i
=0; i
<T
/dt
; i
++){
119 int main(int argc
, char* argv
[]){
121 main_init(argc
, argv
);