-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlevel3.c
66 lines (49 loc) · 1.67 KB
/
level3.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
#include "defines.h"
#include "level4.h"
const uint8_t udg_fishtank1[] = {0x7f, 0x1f, 0x3f, 0x7a, 0x78, 0x7a, 0x3f, 0x0f};
const uint8_t udg_fishtank2[] = {0xfe, 0xf8, 0x3c, 0x1e, 0x2e, 0x1e, 0x7c, 0xf0};
void print_background_level3() {
level = 3;
sp1_Initialize( SP1_IFLAG_MAKE_ROTTBL | SP1_IFLAG_OVERWRITE_TILES | SP1_IFLAG_OVERWRITE_DFILE,
INK_BLACK | PAPER_MAGENTA | BRIGHT,
' ' );
sp1_Invalidate(&full_screen);
sp1_TileEntry('A', udg_fishtank1);
sp1_TileEntry('B', udg_fishtank2);
print_room_walls(12, PAPER_MAGENTA, INK_CYAN);
// paint the chair
paint_chair(10, PAPER_MAGENTA | INK_CYAN | BRIGHT);
// 17,22
paint_table(22, PAPER_MAGENTA | INK_CYAN | BRIGHT);
paint_lamp(26, PAPER_MAGENTA | INK_CYAN | BRIGHT);
// fishtank
sp1_PrintAt( 17, 22, INK_WHITE | PAPER_MAGENTA | BRIGHT, 'A');
sp1_PrintAt( 17, 23, INK_WHITE | PAPER_MAGENTA | BRIGHT, 'B');
reset_misifu_position();
aux_object.y = 5;
aux_object.x = 5;
repaint_lives = 1;
level_x_max = 28;
level_x_min = 1;
}
inline static void check_chair_and_fishtank_level3() {
if(misifu.state == FALLING) {
if(misifu.y == 16 && (misifu.x == 21 || misifu.x == 22)) {
// get inside fishtank and outside of this level
total_points += 10;
level = 4;
print_background_level4();
}
}
if(misifu.in_bin != NONE && misifu.x != 10 && misifu.x != 21 && misifu.x != 22) {
misifu.state = FALLING;
misifu.in_bin = NONE;
}
}
void level3_loop() {
move_broom();
dog_checks();
detect_fall_in_chair(10, 1);
check_chair_and_fishtank_level3();
detect_cat_in_window(8);
}