-
Notifications
You must be signed in to change notification settings - Fork 3
/
game_over.p8
100 lines (82 loc) · 5.77 KB
/
game_over.p8
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
; Game over graphics
; Split in two to fit in array limits
game_over {
ubyte[] victory = [
$20,$20,$20,$20,$20,$E9,$20,$20,$E9,$20,$E9,$20,$E9,$A0,$DF,$20,$E9,$A0,$A0,$A0,$69,$E9,$A0,$A0,$DF,$20,$E9,$A0,$A0,$DF,$20,$E9,$20,$20,$E9,$20,$20,$20,$20,$20,
$43,$43,$43,$43,$72,$C9,$20,$70,$D5,$70,$A0,$70,$F0,$43,$5F,$20,$43,$6E,$D5,$20,$70,$A0,$43,$49,$F0,$70,$C9,$43,$49,$A0,$70,$C3,$20,$70,$A0,$43,$43,$43,$43,$43,
$20,$20,$20,$20,$42,$CA,$20,$5D,$F1,$5D,$C9,$42,$EB,$20,$4A,$20,$20,$5D,$F3,$20,$5D,$F2,$20,$5D,$F1,$42,$CA,$F1,$FD,$69,$4A,$5F,$ED,$F3,$69,$20,$20,$20,$20,$20,
$20,$20,$20,$20,$4A,$5F,$DF,$E9,$69,$5D,$F1,$42,$CB,$20,$20,$E9,$20,$5D,$FD,$20,$5D,$CA,$20,$E9,$69,$42,$A0,$20,$5F,$DF,$20,$4A,$6E,$CA,$20,$20,$20,$20,$20,$20,
$20,$20,$20,$20,$20,$4A,$5F,$69,$20,$5D,$69,$4A,$5F,$A0,$A0,$69,$20,$5D,$69,$20,$4A,$5F,$A0,$69,$20,$42,$69,$20,$4A,$5F,$20,$20,$42,$69,$20,$20,$20,$20,$20,$20,
$20,$20,$20,$20,$20,$20,$4A,$20,$20,$4A,$20,$20,$4A,$43,$43,$20,$20,$4A,$20,$20,$20,$4A,$20,$20,$20,$4A,$20,$20,$20,$4A,$20,$20,$4A,$20,$20,$20,$20,$20,$20,$20 ]
ubyte[] defeat = [
$20,$20,$20,$20,$20,$20,$E9,$A0,$DF,$20,$20,$E9,$A0,$69,$20,$20,$E9,$A0,$A0,$69,$E9,$A0,$69,$20,$20,$E9,$A0,$A0,$DF,$E9,$A0,$A0,$A0,$69,$20,$20,$20,$20,$20,$20,
$43,$43,$43,$43,$43,$72,$EE,$43,$5F,$DF,$70,$C9,$43,$49,$20,$70,$A0,$43,$49,$70,$C9,$43,$49,$20,$70,$EE,$43,$49,$A0,$43,$6E,$C9,$43,$43,$43,$43,$43,$43,$43,$43,
$20,$20,$20,$20,$20,$5D,$EB,$20,$5D,$C9,$5D,$EB,$EE,$69,$20,$5D,$F2,$CB,$69,$5D,$F1,$EE,$69,$20,$5D,$EB,$CB,$69,$A0,$20,$5D,$F3,$20,$20,$20,$20,$20,$20,$20,$20,
$71,$71,$71,$71,$71,$5D,$CA,$20,$5D,$F1,$5D,$FD,$43,$20,$E9,$5D,$CB,$43,$20,$5D,$A0,$43,$20,$E9,$5D,$CB,$20,$5D,$A0,$20,$5D,$ED,$20,$20,$20,$20,$20,$20,$20,$20,
$20,$20,$20,$20,$20,$4A,$5F,$A0,$A0,$69,$4A,$5F,$A0,$A0,$69,$5D,$69,$20,$20,$4A,$5F,$A0,$A0,$69,$42,$69,$20,$5D,$69,$20,$5D,$69,$20,$20,$20,$20,$20,$20,$20,$20,
$20,$20,$20,$20,$20,$20,$4A,$43,$43,$20,$20,$4A,$43,$43,$20,$4A,$20,$20,$20,$20,$4A,$43,$43,$20,$4A,$20,$20,$4A,$20,$20,$4A,$20,$20,$20,$20,$20,$20,$20,$20,$20 ]
ubyte[] victory_col = [
$00,$00,$00,$00,$08,$07,$00,$00,$07,$00,$07,$00,$07,$07,$07,$08,$07,$07,$07,$07,$07,$07,$07,$07,$07,$00,$07,$07,$07,$07,$00,$07,$00,$00,$07,$00,$00,$00,$00,$00,
$0A,$0A,$0A,$0A,$0A,$07,$00,$0A,$07,$0A,$07,$0A,$07,$0A,$07,$08,$0A,$0A,$07,$00,$0A,$07,$0A,$0A,$07,$0A,$07,$0A,$0A,$07,$0A,$07,$00,$0A,$07,$0A,$0A,$0A,$0A,$0A,
$00,$00,$00,$00,$02,$07,$00,$02,$07,$02,$07,$02,$07,$00,$02,$00,$00,$02,$07,$00,$02,$07,$00,$02,$07,$02,$07,$07,$07,$07,$02,$07,$07,$07,$07,$00,$00,$00,$00,$00,
$00,$00,$00,$00,$02,$08,$08,$08,$08,$02,$08,$02,$08,$00,$00,$08,$08,$02,$08,$00,$02,$08,$00,$08,$08,$02,$08,$08,$08,$08,$00,$02,$02,$08,$00,$00,$00,$00,$00,$00,
$00,$00,$00,$00,$00,$09,$08,$08,$00,$09,$08,$09,$08,$08,$08,$08,$08,$09,$08,$00,$09,$08,$08,$08,$08,$09,$08,$00,$09,$08,$00,$00,$09,$08,$00,$00,$00,$00,$00,$00,
$00,$00,$00,$00,$00,$00,$09,$00,$00,$09,$00,$00,$09,$09,$09,$02,$00,$09,$00,$00,$00,$09,$00,$00,$00,$09,$00,$00,$00,$09,$00,$00,$09,$00,$00,$00,$00,$00,$00,$00 ]
ubyte[] defeat_col = [
$00,$00,$00,$00,$00,$00,$0E,$0E,$0E,$00,$00,$0E,$0E,$0E,$00,$00,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$00,$00,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$00,$00,$00,$00,$00,$00,
$0F,$0F,$0F,$0F,$0F,$0F,$0E,$0F,$0E,$0E,$0F,$0E,$0F,$0F,$07,$0F,$0E,$0F,$0F,$0F,$0E,$0F,$0F,$07,$0F,$0E,$0F,$0F,$0E,$0F,$0F,$0E,$0F,$0F,$0F,$0F,$0F,$0F,$0F,$0F,
$00,$00,$00,$00,$00,$0C,$0E,$00,$0C,$0E,$0C,$0E,$0E,$0E,$00,$0C,$0E,$0E,$0E,$0C,$0E,$0E,$0E,$00,$0C,$0E,$0E,$0E,$0E,$00,$0C,$0E,$00,$00,$00,$00,$00,$00,$00,$00,
$00,$00,$00,$00,$00,$0C,$06,$00,$0C,$06,$0C,$06,$0C,$00,$06,$0C,$06,$0C,$00,$0C,$06,$0C,$00,$06,$0C,$06,$00,$0C,$06,$08,$0C,$06,$00,$00,$00,$00,$00,$00,$00,$00,
$00,$00,$00,$00,$00,$0B,$06,$06,$06,$06,$0B,$06,$06,$06,$06,$0B,$06,$00,$00,$0B,$06,$06,$06,$06,$0B,$06,$07,$0B,$06,$08,$0B,$06,$00,$00,$00,$00,$00,$00,$00,$00,
$00,$00,$00,$00,$00,$00,$0B,$0B,$0B,$00,$00,$0B,$0B,$0B,$00,$0B,$00,$00,$00,$00,$0B,$0B,$0B,$00,$0B,$0B,$00,$0B,$00,$00,$0B,$00,$00,$00,$00,$00,$00,$00,$00,$00 ]
const ubyte WDT = 40
const ubyte HGT = 6
sub draw_victory() {
ubyte i
for i in 0 to (WDT*HGT - 1) {
txt.setcc( base.LBORDER + (i % WDT), base.UBORDER + 1 + (i/WDT),
victory[i], victory_col[i] )
}
main.write(1, 3, 10, " congratulations!")
main.write(3, 3, 12, "you have defeated the petaxian")
main.write(3, 3, 13, "invasion force.")
score(true)
}
sub draw_defeat() {
ubyte i
for i in 0 to (WDT*HGT - 1) {
txt.setcc( base.LBORDER + (i % WDT), base.UBORDER + 1 + (i/WDT),
defeat[i], defeat_col[i] )
}
main.write(3, 3, 10, "the petaxians have defeated earths")
main.write(3, 3, 11, "defence force and the invasion has")
main.write(3, 3, 12, "left the planet in ruins.")
score(false)
}
sub score(bool player_won) {
sys.wait(100)
main.write(14, 5, 16, "enemy kill points :")
main.printNumber(27, 16, main.score - main.bonus_score, 5)
sound.score_sound_and_delay()
main.write(14, 5, 17, "stage bonus points :")
main.printNumber(27, 17, main.bonus_score, 5)
sound.score_sound_and_delay()
if player_won {
uword lives_score = main.player_lives * 500
str lives_left = "N"
lives_left[0] = $30 + main.player_lives
main.write(1, 5, 18, lives_left)
main.write(14, 7, 18, "lives left bonus :")
main.printNumber(27, 18, lives_score, 5)
main.score += lives_score
sound.score_sound_and_delay()
}
main.write(14, 5, 19, "total :")
main.printNumber(27, 19, main.score, 5)
sound.score_sound_and_delay()
if main.score > main.hiscore {
main.write(1, 5, 21, "congratulation! new hiscore")
main.hiscore = main.score
}
}
}