Repository navigation
Expand file tree
/
Copy pathgames.html
More file actions
529 lines (499 loc) · 27.8 KB
/
Copy pathgames.html
File metadata and controls
529 lines (499 loc) · 27.8 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Games & PyHope Engine — Python v2</title>
<meta name="description" content="Play 10 original Python v2 and PyHope games: shooters, platformers, racing, Snake Byte, Orb Breaker, animated CC0 sprites, and a 9.4-million-pixel GPU lab.">
<link rel="icon" type="image/svg+xml" href="favicon-v2.svg">
<link rel="stylesheet" href="style.css">
</head>
<body>
<a class="skip-link" href="#main-content">Skip to content</a>
<div class="scroll-progress" id="scroll-progress" aria-hidden="true"></div>
<div class="topbar">
<nav class="topbar-inner" aria-label="Site">
<a href="index.html">Python</a>
<a href="index.html#community">PSF</a>
<a href="docs.html">Docs</a>
<a href="download.html">Downloads</a>
<a class="active" href="games.html">Games</a>
<a href="index.html#community">Community</a>
<a href="playground.html">Playground</a></nav>
</div>
<header class="masthead">
<div class="masthead-inner">
<a class="brand" href="index.html">
<img src="logo-v2.svg" alt="Python v2 logo — two snakes, red and blue" width="64" height="64">
<span class="brand-word">python<sup>™</sup><em>v2</em></span>
</a>
<div class="masthead-tools">
<a class="btn-youtube" href="https://www.youtube.com/@CubeCometYT" target="_blank" rel="noopener">▶ Subscribe @CubeCometYT</a>
<a class="btn-social" href="download.html">Install v1.1</a>
</div>
</div>
</header>
<nav class="mainnav" aria-label="Main">
<div class="mainnav-inner">
<a href="index.html#about">About</a>
<a href="download.html">Downloads</a>
<a href="docs.html">Documentation</a>
<a href="tutorial.html">Tutorial</a>
<a class="nav-current" href="games.html">Games</a>
<a href="index.html#community">Community</a>
<a href="playground.html">Playground</a></div>
</nav>
<section class="page-head game-page-head">
<div class="page-head-inner">
<p class="eyebrow">PYHOPE ENGINE • NO PYGAME • BUILT FOR PYTHON V2</p>
<h1>10 games. One Python v2 arcade.</h1>
<p>Choose from <strong>10 playable games</strong>—shooters, platformers,
racing, snake, and brick-breaking—then inspect the animated CC0
characters and Python v2 source behind them. Or ask the GPU to ray-cast
a real <strong>9,437,184-pixel</strong> frame.</p>
<div class="hero-actions">
<a class="btn btn-yellow" href="#play">Play now</a>
<a class="btn btn-ghost" href="download.html#pyhope">Install PyHope</a>
<a class="btn btn-ghost" href="docs.html#pyhope">Read engine docs</a>
</div>
</div>
</section>
<aside class="youtube-callout reveal-wide">
<div class="youtube-play" aria-hidden="true">▶</div>
<div>
<span class="eyebrow">THE 1,000 SUBSCRIBER QUEST</span>
<h2>Help @CubeCometYT reach 1K</h2>
<p>At 1,000 subscribers, Cube Comet will release a full video showing
how to install Python v2 and the PyHope game engine from start to finish.</p>
</div>
<a class="btn-youtube btn-youtube-big" href="https://www.youtube.com/@CubeCometYT" target="_blank" rel="noopener">Subscribe on YouTube</a>
</aside>
<main id="main-content" class="games-main">
<div class="game-tabs" role="tablist" aria-label="Games and engine sections">
<button role="tab" data-game-tab="play" aria-selected="true">🎮 10 Games</button>
<button role="tab" data-game-tab="gpu">⚡ 9M GPU Lab</button>
<button role="tab" data-game-tab="sprites">👾 Free Sprites</button>
<button role="tab" data-game-tab="source">>_ Python v2 Source</button>
</div>
<!-- ==================== Play ==================== -->
<section data-game-panel="play" id="play" class="game-panel">
<section class="arcade-library" aria-labelledby="arcade-library-title">
<div class="arcade-library-head">
<div>
<p class="eyebrow">PYHOPE ARCADE • 10 ORIGINAL GAMES</p>
<h2 id="arcade-library-title">Pick a game. Click its icon. Play.</h2>
<p>Every illustrated card opens its game below. Games 04–10 share the
Pocket Arcade screen so switching games is instant—no download,
sign-in, or third-party assets.</p>
</div>
<span class="arcade-live"><i></i> 10 games online</span>
</div>
<div class="arcade-grid">
<a class="arcade-card" href="#byte-beast">
<span class="arcade-card-art"><img src="assets/game-icons/byte-beast.svg" alt="Red Byte Beast and blue blaster"></span>
<span class="arcade-card-copy"><b><i>01</i> Byte Beast Arena</b><small>Shooter • 3D raycast</small></span>
<span class="arcade-play-icon" aria-hidden="true">▶</span>
</a>
<a class="arcade-card" href="#comet-hopper">
<span class="arcade-card-art"><img src="assets/game-icons/comet-hopper.svg" alt="Comet Kid jumping over platforms"></span>
<span class="arcade-card-copy"><b><i>02</i> Comet Hopper</b><small>Platformer • adventure</small></span>
<span class="arcade-play-icon" aria-hidden="true">▶</span>
</a>
<a class="arcade-card" href="#comet-circuit">
<span class="arcade-card-art"><img src="assets/game-icons/comet-circuit.svg" alt="Red car on a winding race track"></span>
<span class="arcade-card-copy"><b><i>03</i> Comet Circuit</b><small>Racing • 3 laps</small></span>
<span class="arcade-play-icon" aria-hidden="true">▶</span>
</a>
<a class="arcade-card" data-pocket-game="neon-blaster" href="#pocket-arcade">
<span class="arcade-card-art"><img src="assets/game-icons/neon-blaster.svg" alt="Blue spaceship firing at red drones"></span>
<span class="arcade-card-copy"><b><i>04</i> Neon Blaster</b><small>Shooter • enemy waves</small></span>
<span class="arcade-play-icon" aria-hidden="true">▶</span>
</a>
<a class="arcade-card" data-pocket-game="asteroid-drift" href="#pocket-arcade">
<span class="arcade-card-art"><img src="assets/game-icons/asteroid-drift.svg" alt="Spaceship drifting through asteroids"></span>
<span class="arcade-card-copy"><b><i>05</i> Asteroid Drift</b><small>Shooter • space survival</small></span>
<span class="arcade-play-icon" aria-hidden="true">▶</span>
</a>
<a class="arcade-card" data-pocket-game="target-blitz" href="#pocket-arcade">
<span class="arcade-card-art"><img src="assets/game-icons/target-blitz.svg" alt="Bright target in a precision reticle"></span>
<span class="arcade-card-copy"><b><i>06</i> Target Blitz</b><small>Shooter • mouse & touch</small></span>
<span class="arcade-play-icon" aria-hidden="true">▶</span>
</a>
<a class="arcade-card" data-pocket-game="skybound" href="#pocket-arcade">
<span class="arcade-card-art"><img src="assets/game-icons/skybound.svg" alt="Comet Kid jumping between sky platforms"></span>
<span class="arcade-card-copy"><b><i>07</i> Skybound</b><small>Platformer • endless climb</small></span>
<span class="arcade-play-icon" aria-hidden="true">▶</span>
</a>
<a class="arcade-card" data-pocket-game="turbo-trail" href="#pocket-arcade">
<span class="arcade-card-art"><img src="assets/game-icons/turbo-trail.svg" alt="Blue car racing down a sunset highway"></span>
<span class="arcade-card-copy"><b><i>08</i> Turbo Trail</b><small>Racing • endless traffic</small></span>
<span class="arcade-play-icon" aria-hidden="true">▶</span>
</a>
<a class="arcade-card" data-pocket-game="snake-byte" href="#pocket-arcade">
<span class="arcade-card-art"><img src="assets/game-icons/snake-byte.svg" alt="Green pixel snake collecting a Hope Bit"></span>
<span class="arcade-card-copy"><b><i>09</i> Snake Byte</b><small>Arcade • grid challenge</small></span>
<span class="arcade-play-icon" aria-hidden="true">▶</span>
</a>
<a class="arcade-card" data-pocket-game="orb-breaker" href="#pocket-arcade">
<span class="arcade-card-art"><img src="assets/game-icons/orb-breaker.svg" alt="Glowing orb bouncing toward colorful bricks"></span>
<span class="arcade-card-copy"><b><i>10</i> Orb Breaker</b><small>Arcade • brick breaker</small></span>
<span class="arcade-play-icon" aria-hidden="true">▶</span>
</a>
</div>
<aside class="game-portfolio-callout">
<div class="portfolio-mini-preview" aria-hidden="true"><span>AC</span><i></i><i></i><i></i></div>
<div><p class="eyebrow">NEW • CREATOR PORTFOLIO STARTER</p><h3>Put your games inside your own website.</h3><p>The Playground now builds a personal profile, project portfolio, and playable-game showcase from editable Python v2 data—with live preview and generated HTML.</p></div>
<a class="btn btn-yellow" href="playground.html#website-workshop">Build my portfolio →</a>
</aside>
</section>
<div class="game-divider arcade-divider"></div>
<div class="game-title-row" id="byte-beast">
<div>
<p class="eyebrow">GAME 01 • SOFTWARE RAYCASTER</p>
<h2>PyHope: Byte Beast Arena</h2>
<p>The original CPU raycaster, upgraded with billboard sprites,
monster AI, a blaster, hit detection, health, kills, and an honest
running pixel counter. It passes <strong>9 million software-rendered
pixels in under three seconds</strong> at 60 FPS.</p>
</div>
<div class="engine-pill">CPU • 57,600 px/frame</div>
</div>
<div class="game-stage game-stage-arena">
<canvas id="arena-canvas" width="320" height="180" aria-label="Byte Beast Arena. Click, use WASD to move, arrows to turn, space to fire."></canvas>
<div class="game-hud game-hud-rich">
<span id="arena-fps">– FPS</span>
<span id="arena-kills">MONSTERS 5 • KILLS 0 • HP 100</span>
<span id="arena-pixels">0 pixels rendered</span>
<span id="arena-pos">x 6.0 y 2.0</span>
</div>
</div>
<div class="control-strip">
<span><kbd>W</kbd><kbd>A</kbd><kbd>S</kbd><kbd>D</kbd> move</span>
<span><kbd>←</kbd><kbd>→</kbd> turn</span>
<span><kbd>Space</kbd> / <kbd>F</kbd> fire</span>
<span><kbd>Shift</kbd> sprint</span>
<span>or click the focused game to fire</span>
</div>
<div class="game-divider"></div>
<div class="game-title-row" id="comet-hopper">
<div>
<p class="eyebrow">GAME 02 • ORIGINAL PLATFORMER</p>
<h2>Comet Hopper</h2>
<p>A legal, original classic-style platform game—not Mario and not
ripped Nintendo art. Python v2 generates the level rows; PyHope
handles movement, collision, enemies, coins, camera, and Canvas
rendering.</p>
</div>
<div class="engine-pill engine-pill-blue">PYTHON V2 LEVEL</div>
</div>
<div class="game-stage platform-stage">
<canvas id="platform-canvas" width="640" height="360" aria-label="Comet Hopper. Click, move with A and D, jump with W or Space."></canvas>
<div class="game-hud">
<span id="platform-status">HOPE BITS 0 • level generated by Python v2</span>
<button id="platform-reset" type="button">Restart</button>
</div>
</div>
<div class="control-strip">
<span><kbd>A</kbd><kbd>D</kbd> or <kbd>←</kbd><kbd>→</kbd> run</span>
<span><kbd>W</kbd> / <kbd>↑</kbd> / <kbd>Space</kbd> jump</span>
<span>jump on Null Slimes • collect Hope Bits • reach the red flag</span>
</div>
<div class="game-divider"></div>
<div class="game-title-row" id="comet-circuit">
<div>
<p class="eyebrow">GAME 03 • TOP-DOWN RACING</p>
<h2>Comet Circuit</h2>
<p>Race three AI drivers around a Python v2-generated track. PyHope
handles acceleration, reverse, speed-sensitive steering, road grip,
grass drag, lap timing, camera tracking, and a best-time finish.</p>
</div>
<div class="engine-pill engine-pill-racing">PYTHON V2 TRACK</div>
</div>
<div class="game-stage racing-stage">
<canvas id="racing-canvas" width="800" height="450" aria-label="Comet Circuit racing game. Click, accelerate with W or Up, and steer with A D or arrow keys."></canvas>
<div class="game-hud">
<span id="racing-status">LAP 1/3 • 0 KM/H • Python v2 track</span>
<button id="racing-reset" type="button">Restart race</button>
</div>
</div>
<div class="control-strip">
<span><kbd>W</kbd> / <kbd>↑</kbd> accelerate</span>
<span><kbd>S</kbd> / <kbd>↓</kbd> brake & reverse</span>
<span><kbd>A</kbd><kbd>D</kbd> or <kbd>←</kbd><kbd>→</kbd> steer</span>
<span><kbd>R</kbd> restart • complete 3 laps</span>
</div>
<div class="game-divider"></div>
<section class="pocket-arcade" id="pocket-arcade" aria-labelledby="arcade-title">
<div class="game-title-row pocket-title-row">
<div>
<p class="eyebrow" id="arcade-badge">GAME 04 • WAVE SHOOTER</p>
<h2 id="arcade-title">Neon Blaster</h2>
<p id="arcade-description">Pilot the Comet, weave through Null Drones,
and stream blue energy through an endless neon attack wave.</p>
</div>
<div class="engine-pill engine-pill-pocket">PYTHON V2 ARCADE</div>
</div>
<div class="pocket-picker" aria-label="Choose a Pocket Arcade game">
<button type="button" data-pocket-game="neon-blaster">04 Neon Blaster</button>
<button type="button" data-pocket-game="asteroid-drift">05 Asteroid Drift</button>
<button type="button" data-pocket-game="target-blitz">06 Target Blitz</button>
<button type="button" data-pocket-game="skybound">07 Skybound</button>
<button type="button" data-pocket-game="turbo-trail">08 Turbo Trail</button>
<button type="button" data-pocket-game="snake-byte">09 Snake Byte</button>
<button type="button" data-pocket-game="orb-breaker">10 Orb Breaker</button>
</div>
<div class="game-stage pocket-stage">
<canvas id="arcade-canvas" width="800" height="450" aria-label="Pocket Arcade game canvas. Select one of seven games, click, and use the displayed controls."></canvas>
<div class="game-hud">
<span id="arcade-status">SCORE 0 • SHIELDS 3</span>
<button id="arcade-reset" type="button">Restart game</button>
</div>
</div>
<div class="control-strip arcade-control-strip">
<span class="live-dot" aria-hidden="true"></span>
<strong id="arcade-controls">WASD / arrows move • Space or click fires • R restarts</strong>
<span>Click the canvas first to focus keyboard controls.</span>
</div>
</section>
</section>
<!-- ==================== GPU ==================== -->
<section data-game-panel="gpu" id="gpu" class="game-panel" hidden>
<div class="game-title-row">
<div>
<p class="eyebrow">PYHOPE GPU RAYCASTER • WEBGL2</p>
<h2>Over nine million ray-cast pixels</h2>
<p><strong>Live mode</strong> runs at 1280×720. The opt-in
<strong>9M frame</strong> button resizes the real GPU canvas to
4096×2304 and ray-casts <strong>9,437,184 fragments</strong>.
It renders one still frame so small devices do not melt.</p>
</div>
<div class="engine-pill engine-pill-gpu">GPU • WEBGL2</div>
</div>
<div class="benchmark-note">
<strong>Honest benchmark:</strong> this is not CSS upscaling. In 9M mode,
<code>canvas.width × canvas.height</code> is exactly
<code>4096 × 2304</code>. Ray work and the large framebuffer stay on the
GPU instead of a 9-million-item Python list. It is memory-efficient—not
“zero RAM,” because every real browser and game needs memory.
</div>
<div class="game-stage gpu-stage">
<canvas id="gpu-canvas" width="1280" height="720" aria-label="GPU raycaster. Start live mode, click the canvas, and use WASD and arrow keys."></canvas>
<div class="game-hud">
<span id="gpu-status">GPU READY • press Start live</span>
</div>
</div>
<div class="gpu-actions">
<button class="btn btn-blue" id="gpu-live" type="button">▶ Start live 720p</button>
<button class="btn btn-yellow" id="gpu-9m" type="button">⚡ Render 9,437,184 pixels</button>
</div>
<div class="control-strip">
<span><kbd>W</kbd><kbd>A</kbd><kbd>S</kbd><kbd>D</kbd> move</span>
<span><kbd>←</kbd><kbd>→</kbd> turn</span>
<span>WebGL2 fragment shader • DDA grid rays • procedural walls</span>
</div>
</section>
<!-- ==================== Sprites ==================== -->
<section data-game-panel="sprites" id="sprites" class="game-panel" hidden>
<p class="eyebrow">ORIGINAL ASSETS • ANIMATED • PUBLIC DOMAIN</p>
<h2>Meet the animated PyHope cast</h2>
<p class="panel-lede">These characters and game objects were drawn for
Python v2 and dedicated to the public domain under CC0. Hover or focus a
card to trigger its animation, then download the crisp SVG for your own
Python v2 game. No Nintendo, Mario, or third-party art.</p>
<div class="sprite-animation-note"><span aria-hidden="true">✦</span><strong>Animation lab:</strong> run, hover, squash, recoil, drive, and spin previews—all CSS-powered and reduced-motion safe.</div>
<div class="sprite-grid sprite-grid-animated">
<article class="sprite-card motion-run" tabindex="0">
<div class="sprite-preview"><img src="assets/sprites/comet-hero.svg" alt="Animated Comet Kid pixel sprite"></div>
<h3>Comet Kid</h3><p>Original platform hero.</p>
<a href="assets/sprites/comet-hero.svg" download>Download SVG</a>
</article>
<article class="sprite-card motion-float" tabindex="0">
<div class="sprite-preview"><img src="assets/sprites/monster.svg" alt="Animated Byte Beast pixel sprite"></div>
<h3>Byte Beast</h3><p>Raycaster monster.</p>
<a href="assets/sprites/monster.svg" download>Download SVG</a>
</article>
<article class="sprite-card motion-squash" tabindex="0">
<div class="sprite-preview"><img src="assets/sprites/slime.svg" alt="Animated Null Slime pixel sprite"></div>
<h3>Null Slime</h3><p>Squishy platform enemy.</p>
<a href="assets/sprites/slime.svg" download>Download SVG</a>
</article>
<article class="sprite-card motion-blast" tabindex="0">
<div class="sprite-preview sprite-preview-wide"><img src="assets/sprites/blaster.svg" alt="Animated Comet Blaster weapon sprite"></div>
<h3>Comet Blaster</h3><p>Original sci-fi weapon.</p>
<a href="assets/sprites/blaster.svg" download>Download SVG</a>
</article>
<article class="sprite-card motion-spin" tabindex="0">
<div class="sprite-preview"><img src="assets/sprites/coin.svg" alt="Animated Hope Bit coin sprite"></div>
<h3>Hope Bit</h3><p>Shiny collectible.</p>
<a href="assets/sprites/coin.svg" download>Download SVG</a>
</article>
<article class="sprite-card motion-run" tabindex="0">
<div class="sprite-preview"><img src="assets/sprites/comet-pilot.svg" alt="Animated Comet Pilot shooter sprite"></div>
<h3>Comet Pilot</h3><p>Neon Blaster hero.</p>
<a href="assets/sprites/comet-pilot.svg" download>Download SVG</a>
</article>
<article class="sprite-card motion-float" tabindex="0">
<div class="sprite-preview"><img src="assets/sprites/drone.svg" alt="Animated Null Drone enemy sprite"></div>
<h3>Null Drone</h3><p>Flying shooter enemy.</p>
<a href="assets/sprites/drone.svg" download>Download SVG</a>
</article>
<article class="sprite-card motion-drive" tabindex="0">
<div class="sprite-preview sprite-preview-wide"><img src="assets/sprites/race-car.svg" alt="Animated Comet Racer car sprite"></div>
<h3>Comet Racer</h3><p>Top-down race car.</p>
<a href="assets/sprites/race-car.svg" download>Download SVG</a>
</article>
<article class="sprite-card sprite-license-card">
<div class="sprite-preview"><span>CC0</span></div>
<h3>No strings attached</h3><p>Read the public-domain dedication.</p>
<a href="assets/sprites/LICENSE.md">View license</a>
</article>
</div>
</section>
<!-- ==================== Source ==================== -->
<section data-game-panel="source" id="source" class="game-panel" hidden>
<p class="eyebrow">READ IT • CHANGE IT • SHIP IT</p>
<h2>The arcade is wired to real Python v2 code</h2>
<p class="panel-lede">When this page starts, the browser interpreter runs
Python v2 scripts. Printed rows become Comet Hopper's level; coordinate
pairs become Comet Circuit's track; and a seven-game manifest configures
Pocket Arcade. PyHope supplies physics, sprites, cameras, AI, and renderers.</p>
<div class="source-split">
<pre class="terminal"><code>level = [
"........................................",
"...........................C............",
".............C...........####...........",
".........#####..........................",
"..C..................M.................F",
"#####...........########..............###",
"........................................",
"########################################",
]
for row in level:
print(row)
end</code></pre>
<div class="api-list">
<h3>PyHope 1.1 includes</h3>
<ul class="checklist">
<li><code>Vec2</code> math and movement</li>
<li><code>Sprite</code> entities and tags</li>
<li><code>TileMap</code> collision</li>
<li>fixed-step <code>Engine</code> scenes</li>
<li>DDA <code>raycast()</code></li>
<li>ASCII terminal preview</li>
<li>Canvas platform renderer</li>
<li>Top-down racing physics + AI</li>
<li>Seven Pocket Arcade game modes</li>
<li>Animated CC0 character sprites</li>
<li>CPU sprite raycaster</li>
<li>WebGL2 9M renderer</li>
</ul>
<a class="btn btn-blue" href="docs.html#pyhope">PyHope API guide</a>
<a class="btn btn-ghost-dark" href="https://github.com/gefrus112/pythonv2">View all source</a>
</div>
</div>
<div class="python-game-code">
<div class="python-game-code-copy">
<p class="eyebrow">REAL .PYV2 GAME LOGIC</p>
<h3>Characters, animation states, and shooters</h3>
<p>The browser executes a Python v2 manifest to configure games 04–10.
The repository also includes a playable terminal edition of Neon
Blaster and reusable character animation state code.</p>
<div class="source-downloads">
<a class="btn btn-blue" href="examples/games/neon_blaster.pyv2" download>Download shooter code</a>
<a class="btn btn-ghost-dark" href="examples/games/sprite_animation.pyv2" download>Animation code</a>
</div>
</div>
<pre class="terminal"><code>character = {
name: "Comet Pilot",
state: "idle",
frame: 0,
}
animations = {
idle: [0, 1, 0, 2],
run: [3, 4, 5, 4],
jump: [6, 7],
fire: [8, 9, 8],
}
fn play(state, loops):
for loop in range(loops):
for frame in animations[state]:
character.frame = frame
print(f"{state} frame {frame}")
end
end
end
play("run", 2)</code></pre>
</div>
</section>
</main>
<section class="youtube-bottom">
<div>
<p class="eyebrow">NEXT MILESTONE: 1,000 SUBSCRIBERS</p>
<h2>Want the full video install tutorial?</h2>
<p>Subscribe to Cube Comet. At 1K, the Python v2 + PyHope installation
walkthrough goes live.</p>
</div>
<a class="btn-youtube btn-youtube-big" href="https://www.youtube.com/@CubeCometYT" target="_blank" rel="noopener">▶ Subscribe @CubeCometYT</a>
</section>
<footer class="footer">
<div class="footer-inner">
<div class="footer-col"><h4>Python v2</h4><a href="index.html">Home</a><a href="download.html">Downloads</a><a href="tutorial.html">Tutorial</a></div>
<div class="footer-col"><h4>Games</h4><a href="games.html#play">All 10 games</a><a href="games.html#byte-beast">Shooters</a><a href="games.html#comet-hopper">Platformers</a><a href="games.html#comet-circuit">Racing</a><a href="games.html#gpu">9M GPU Lab</a></div>
<div class="footer-col"><h4>PyHope</h4><a href="download.html#pyhope">Install engine</a><a href="docs.html#pyhope">Engine docs</a><a href="games.html#source">Python v2 source</a></div>
<div class="footer-col"><h4>Community</h4><a href="https://www.youtube.com/@CubeCometYT">YouTube</a><a href="https://github.com/gefrus112/pythonv2">GitHub</a><a href="https://github.com/gefrus112/pythonv2/issues">Issues</a></div>
<div class="footer-col"><h4>Learn</h4><a href="guide.html">50 things to read</a><a href="docs.html">Reference</a><a href="assets/sprites/LICENSE.md">Sprite license</a></div>
</div>
<div class="footer-legal"><p><img src="favicon-v2.svg" alt="" width="22" height="22">© <span id="year">2026</span> Python v2 + PyHope. Original game assets are CC0.</p></div>
</footer>
<!-- Python v2 configures all seven Pocket Arcade games at startup. -->
<script id="arcade-manifest" type="text/pyv2">
games = [
["neon-blaster", "Neon Blaster", "WAVE SHOOTER"],
["asteroid-drift", "Asteroid Drift", "SPACE SHOOTER"],
["target-blitz", "Target Blitz", "PRECISION SHOOTER"],
["skybound", "Skybound", "ARCADE PLATFORMER"],
["turbo-trail", "Turbo Trail", "ENDLESS RACING"],
["snake-byte", "Snake Byte", "GRID ARCADE"],
["orb-breaker", "Orb Breaker", "BRICK BREAKER"],
]
for game in games:
print(game[0] + "|" + game[1] + "|" + game[2])
end
</script>
<!-- Python v2 generates the racing circuit used by Comet Circuit. -->
<script id="racing-track" type="text/pyv2">
track = [
[280, 450], [350, 245], [560, 145], [825, 165], [1060, 290],
[1145, 500], [1035, 710], [790, 785], [515, 735], [300, 590],
]
for point in track:
print(point[0] + "," + point[1])
end
</script>
<!-- This Python v2 program is executed by games.js to build the platform level. -->
<script id="platform-level" type="text/pyv2">
level = [
"................................................................",
"................................................................",
"..............................................................F.",
"...........................C..................................###",
".............C...........####...........C.......................",
".........#####........................#####.............C........",
"..C..................M................................####.......",
"#####...........########...........M.........................####",
".....####........................####...........#####.............",
"..........C.........C............................................",
"################################################################",
]
for row in level:
print(row)
end
</script>
<script src="pyv2.js"></script>
<script src="game.js"></script>
<script src="gpu-game.js"></script>
<script src="site.js"></script>
<script src="games.js"></script>
<script src="arcade.js"></script>
</body>
</html>