Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Latest commit

 

History

History
History
59 lines (46 loc) · 1.37 KB

File metadata and controls

59 lines (46 loc) · 1.37 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#include "pipearray.h"
#include <vram.h>
#include "bird.h"
#include "patterns.h"
#include "pipe.h"
pipe_t pipearray[PIPEARRAY_SIZE];
void pipearray_init(void) {
uint8_t i, j;
uint8_t k = BIRD_OBMAS_SIZE;
for (i = 0; i < PIPEARRAY_SIZE; i++) {
pipearray[i].holex = i * 64 + SCREEN_WIDTH - 16;
pipe_newy(pipearray + i);
pipearray[i].obmas[0] = k;
OBM[k].pattern_config = pipe_top_pattern_pmfa;
OBM[k].color = GREEN_C_MASK;
k++;
pipearray[i].obmas[1] = k;
OBM[k].pattern_config = pipe_top_pattern_pmfa | VFLIP_MASK;
OBM[k].color = GREEN_C_MASK;
k++;
for (j = 2; j < PIPE_OBMAS_SIZE; j++) {
pipearray[i].obmas[j] = k;
OBM[k].pattern_config = pipe_body_pattern_pmfa;
OBM[k].color = GREEN_C_MASK;
k++;
}
}
}
// returns true if 1 should be added to the score
bool pipearray_move(void) {
uint8_t i;
bool addscore = false;
for (i = 0; i < PIPEARRAY_SIZE; i++)
if (pipe_move(pipearray + i)) addscore = true;
return addscore;
}
void pipearray_draw(void) {
uint8_t i;
for (i = 0; i < PIPEARRAY_SIZE; i++) pipe_draw(pipearray + i);
}
bool pipearray_collision(bird_t* bird) {
uint8_t i;
for (i = 0; i < PIPEARRAY_SIZE; i++)
if (pipe_collision(pipearray + i, bird)) return true;
return false;
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.