Skip to content

Commit 77708dc

Browse files
committed
Add Super Pong
1 parent f8c147e commit 77708dc

File tree

6 files changed

+304
-0
lines changed

6 files changed

+304
-0
lines changed

Diff for: authors.json

+3
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,8 @@
8787
},
8888
"fontz": {
8989
"url": "https://github.com/fontz"
90+
},
91+
"offstatic": {
92+
"url": "https://github.com/offstatic"
9093
}
9194
}

Diff for: programs.json

+30
Original file line numberDiff line numberDiff line change
@@ -2201,5 +2201,35 @@
22012201
"logicQuirks": false,
22022202
"fontStyle": "fish"
22032203
}
2204+
},
2205+
"superpong": {
2206+
"title": "Super Pong",
2207+
"authors": ["offstatic"],
2208+
"images": ["superpong.gif"],
2209+
"desc": "A fast pong-like.",
2210+
"event": "Octojam8",
2211+
"release": "2021-10-15",
2212+
"platform": "chip8",
2213+
"options": {
2214+
"tickrate": 30,
2215+
"fillColor": "#43523d",
2216+
"fillColor2": "#ff6600",
2217+
"blendColor": "#662200",
2218+
"backgroundColor": "#c7f0d8",
2219+
"buzzColor": "#FFAA00",
2220+
"quietColor": "#000000",
2221+
"shiftQuirks": false,
2222+
"loadStoreQuirks": false,
2223+
"vfOrderQuirks": false,
2224+
"clipQuirks": false,
2225+
"vBlankQuirks": false,
2226+
"jumpQuirks": false,
2227+
"logicQuirks": false,
2228+
"screenRotation": 0,
2229+
"maxSize": 3584,
2230+
"touchInputMode": "none",
2231+
"fontStyle": "octo"
2232+
2233+
}
22042234
}
22052235
}

Diff for: roms/superpong.ch8

595 Bytes
Binary file not shown.

Diff for: src/superpong/Readme.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
WASD controls the paddles and E resets.

Diff for: src/superpong/superpong.8o

+270
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
: ball 0x80
2+
3+
: paddle1 0x80 0x80 0x80 0x80 0x80 0x80
4+
5+
: paddle2 0xFC
6+
7+
: border-vert 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
8+
9+
: border-hori 0xFF
10+
11+
: bcd-digits 0 0 0
12+
13+
: title-image
14+
0xFF 0x8A 0xBA 0x8A 0xEA 0xEA 0x88 0xFF 0x22 0x2A 0x22 0x2E 0x2E 0x2E 0x3F
15+
0xFF 0x88 0xAB 0x88 0xBB 0xBB 0xB8 0xFF 0x22 0xAA 0xAA 0x2A 0x2A 0x2A 0xFF
16+
0xF8 0x88 0xA8 0x88 0x98 0xA8 0xA8 0xF8 0x20 0xE0 0xA0 0xA0 0xA0 0x20 0xE0
17+
18+
: game-over-image
19+
0xFF 0x88 0xBA 0xA8 0xAA 0xAA 0x8A 0xFF
20+
0xFF 0x84 0x95 0x94 0xB5 0xB5 0xB4 0xFF
21+
0xFF 0x45 0xD5 0x55 0xC5 0xC5 0x46 0xFF
22+
0xFF 0x44 0x5D 0x44 0x5C 0x5D 0xC5 0xFF
23+
0xC0 0x40 0x40 0x40 0xC0 0x40 0x40 0xC0
24+
25+
: keyprompt 0xFE 0x62 0x2E 0x26 0x2E 0x22 0x3E
26+
27+
:alias ball-x v3
28+
:alias ball-y v4
29+
:alias ball-speed-x v5
30+
:alias ball-speed-y v6
31+
32+
:alias paddle-top-x v7
33+
:alias paddle-bot-x v8
34+
:alias paddle-vert-y v9
35+
36+
:alias paddle-hori-x va
37+
:alias paddle-left-y vb
38+
:alias paddle-right-y vc
39+
40+
:alias score vd
41+
42+
: main
43+
title-screen
44+
clear-screen
45+
46+
loop
47+
sync
48+
draw
49+
ball-x += ball-speed-x
50+
ball-y += ball-speed-y
51+
ve := 5 if ve key then paddle-vert-y -= 2
52+
ve := 8 if ve key then paddle-vert-y += 2
53+
ve := 7 if ve key then paddle-hori-x -= 2
54+
ve := 9 if ve key then paddle-hori-x += 2
55+
draw
56+
if vf != 0 then collide
57+
if ball-x == 63 then game-over
58+
if ball-x == 0 then game-over
59+
if ball-y == 31 then game-over
60+
if ball-y == 0 then game-over
61+
ve := 6 if ve key then clear-screen
62+
again
63+
64+
: draw
65+
i := paddle1
66+
sprite paddle-top-x paddle-vert-y 6
67+
sprite paddle-bot-x paddle-vert-y 6
68+
i := paddle2
69+
sprite paddle-hori-x paddle-left-y 1
70+
sprite paddle-hori-x paddle-right-y 1
71+
i := ball
72+
sprite ball-x ball-y 1
73+
;
74+
75+
: collide
76+
draw-score
77+
ve := random 3
78+
if ball-x == 1 begin
79+
ball-speed-x := 1
80+
paddle-hori-collide
81+
end
82+
if ball-x == 62 begin
83+
ball-speed-x := -1
84+
paddle-hori-collide
85+
end
86+
if ball-y == 1 begin
87+
ball-speed-y := 1
88+
paddle-vert-collide
89+
end
90+
if ball-y == 30 begin
91+
ball-speed-y := -1
92+
paddle-vert-collide
93+
end
94+
draw-score
95+
;
96+
97+
: paddle-hori-collide
98+
if ve == 0 then ball-speed-y := 0
99+
if ve != 0 begin
100+
ve := paddle-vert-y
101+
ve += 3
102+
if ball-y <= ve then ball-speed-y := -1
103+
if ball-y > ve then ball-speed-y := 1
104+
end
105+
score += 1
106+
;
107+
108+
: paddle-vert-collide
109+
if ve == 0 then ball-speed-x := 0
110+
if ve != 0 begin
111+
ve := paddle-hori-x
112+
ve += 3
113+
if ball-x <= ve then ball-speed-x := -1
114+
if ball-x > ve then ball-speed-x := 1
115+
end
116+
score += 1
117+
;
118+
119+
: reset
120+
ball-x := 32
121+
ball-y := 16
122+
paddle-top-x := 1
123+
paddle-bot-x := 62
124+
paddle-vert-y := 13
125+
paddle-hori-x := 29
126+
paddle-left-y := 1
127+
paddle-right-y := 30
128+
score := 0
129+
130+
ve := random 1
131+
if ve == 0 begin
132+
ball-speed-x := 1
133+
end
134+
if ve == 1 begin
135+
ball-speed-x := -1
136+
end
137+
138+
ve := random 3
139+
if ve == 0 then ball-speed-y := 0
140+
if ve == 1 then ball-speed-y := -1
141+
if ve > 1 then ball-speed-y := 1
142+
;
143+
144+
: clear-screen
145+
clear
146+
border
147+
reset
148+
draw-score
149+
draw
150+
;
151+
152+
: draw-score
153+
i := bcd-digits
154+
bcd score
155+
load v2
156+
v0 := 27
157+
ve := 13
158+
i := hex v1
159+
sprite v0 ve 5
160+
v0 += 5
161+
i := hex v2
162+
sprite v0 ve 5
163+
;
164+
165+
: sync
166+
loop
167+
ve := delay
168+
if ve != 0 then
169+
again
170+
171+
if score < 6 then ve := 3
172+
if score > 5 begin
173+
if score < 11 then ve := 2
174+
end
175+
if score > 10 begin
176+
if score < 16 then ve := 1
177+
end
178+
if score > 15 then ve := 0
179+
delay := ve
180+
;
181+
182+
: game-over
183+
clear
184+
draw-score
185+
border
186+
sync
187+
border
188+
sync
189+
border
190+
sync
191+
border
192+
border
193+
draw-game-over
194+
draw-keyprompt
195+
196+
loop
197+
ve := key
198+
if ve != 6 then
199+
again
200+
clear-screen
201+
;
202+
203+
: draw-game-over
204+
i := game-over-image
205+
vd := 15
206+
ve := 3
207+
v0 := 8
208+
loop
209+
sprite vd ve 8
210+
i += v0
211+
vd += 8
212+
if vd != 55 then
213+
again
214+
;
215+
216+
: border
217+
vd := 0
218+
ve := 1
219+
i := border-vert
220+
sprite vd ve 15
221+
ve += 15
222+
sprite vd ve 15
223+
vd := 63
224+
sprite vd ve 15
225+
ve -= 15
226+
sprite vd ve 15
227+
228+
ve := 0
229+
draw-hori-border
230+
ve += 31
231+
draw-hori-border
232+
;
233+
234+
: draw-hori-border
235+
vd := 0
236+
i := border-hori
237+
loop
238+
sprite vd ve 1
239+
vd += 8
240+
if vd != 64 then
241+
again
242+
;
243+
244+
: title-screen
245+
border
246+
i := title-image
247+
vd := 21
248+
ve := 8
249+
v0 := 15
250+
sprite vd ve 15
251+
vd += 8
252+
i += v0
253+
sprite vd ve 15
254+
vd += 8
255+
i += v0
256+
sprite vd ve 15
257+
258+
draw-keyprompt
259+
loop
260+
ve := key
261+
if ve != 6 then
262+
again
263+
;
264+
265+
: draw-keyprompt
266+
i := keyprompt
267+
vd := 55
268+
ve := 23
269+
sprite vd ve 7
270+
;

Diff for: src/superpong/superpong.gif

41.6 KB
Loading

0 commit comments

Comments
 (0)