-
Notifications
You must be signed in to change notification settings - Fork 0
/
graeber.c
executable file
·119 lines (101 loc) · 3.02 KB
/
graeber.c
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// Graeber
//
// Copyright (C) 2018-2021 Heiko Wolf
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License As published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that 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.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// Kontakt: projekte@kabelmail.net
#include "globals.h"
#include "init.h"
#include "player.h"
#include "hud.h"
#include "gegner.h"
#include "lvlstatus.h"
#include "intro.h"
#include "daten/gameover.h"
#include "daten/win.h"
void main (void)
{
p_init (); v_quit = FALSE;
p_intro ();
while (v_quit == FALSE)
{
p_init2 ();
v_gameover = FALSE; v_movetimer = 0; v_angriffstimer = 0; v_tick = 0; v_gegnerlooptime = 0;
while (v_gameover == FALSE)
{
if ((v_gegnerlooptime == v_gspeed) && (v_kampf == TRUE))
{
p_gegner_move_horizontal ();
p_gegner_move_vertikal ();
p_gegner_stachel ();
v_gegnerlooptime = 0;
}
if (v_movetimer == 6)
{
if (joypad () & J_UP) p_player_moveNorth ();
if (joypad () & J_DOWN) p_player_moveSouth ();
if (joypad () & J_LEFT) p_player_moveWest ();
if (joypad () & J_RIGHT) p_player_moveEast ();
v_movetimer = 0;
}
if ((joypad () & J_A) && (v_sangriff == FALSE))
{
p_lvl_whichLvL ();
if (v_aktion == FALSE) { p_player_schlag (); }
}
v_aktion = FALSE;
if (v_angriffstimer == 8)
{
move_sprite (1, 0, 0);
v_sangriff = FALSE;
}
v_movetimer++;
v_tick++;
if (v_sangriff == TRUE) v_angriffstimer++;
if (v_kampf == TRUE) v_gegnerlooptime++;
if (v_tick == 60)
{
v_timer--;
v_tick = 0;
}
if ((v_slp <= 0) || (v_timer <= 0) || (v_shalt <= 0))
{
HIDE_SPRITES;
set_sprite_tile (0, 0);
set_bkg_tiles (0, 0, 20, 18, gameover);
p_gegner_stop ();
move_sprite (0, 0, 0);
move_sprite (1, 0, 0);
waitpad (J_START);
v_gameover = TRUE;
}
if (v_edelstein == 1)
{
HIDE_SPRITES;
set_sprite_tile (0, 0);
set_bkg_tiles (0, 0, 20, 18, win);
p_gegner_stop ();
move_sprite (0, 0, 0);
move_sprite (1, 0, 0);
waitpad (J_START);
v_gameover = TRUE;
}
p_gegner_kolision ();
p_hud_show ();
wait_vbl_done ();
}
}
}