Be Quick or be Dead by Nick Shcherbyna
About
(c) 2021 Nick Shcherbyna (Lviv, Ukraine) [email protected]
=< INSTRUCTIONS >=========================================================
Pretty standard situation for Wild West - two cowboys with guns are starting the duel. Shoot first or die, be quick or be dead!
After signal a message "Press [?] to shoot" appears on the screen, with a random
lowercase letter shown. Strike the corresponding key immediately, otherwise your
opponent will shoot first and kill you. After shooting press [SPACE] to initiate
another duel.
=< SOURCE CODE EXPLAINED >======================================================
0 Disable sleeping. Clear screen. Display game title and copyright. Wait for any
key or timeout.
1 Clear screen. Draw left and right (mirrored) cowboys.
2 Draw ground (3D projection). Pick random letter and show message after signal.
Pick random timeout.
3 Wait for valid keypress or timeout. Determine who pulled a trigger first. Draw
the gun.
4 Get shooting direction. Play sound. Animate the bullet.
5 Wipe the standing cowboy and draw a dead one simultaneously.
6 Print win/dead message. Animate the smoking gun until spacebar is pressed.
7 Cowboy image scanlines. Two values specify start and end coordinates. Negative
start prevents incrementing the scanline (absolute value is used). Zero end is
a stop mark.
8 Cowboy image scanlines, continued.
9 Cowboy image scanlines, continued. Signal frequency. Gun component widths.
===============================================================