--- title: "Galactic Monsters" id: 71286 type: "computer_media" slug: "galactic-monsters" url: "http://localhost/computer_media/galactic-monsters/" markdown_url: "http://localhost/computer_media/galactic-monsters.md" published_at: "2026-09-02T07:10:23+00:00" modified_at: "2026-09-02T07:10:23+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/09/galactic-monsters-1.png" excerpt: "Pilot your spaceship through eleven homing monsters using custom-drawn sprites, with enemies growing smarter and faster each wave you survive." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" basic: - name: "User Defined Graphics (UDG)" slug: "user-defined-graphics-udg" taxonomy: "basic" url: "http://localhost/basic/user-defined-graphics-udg/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Hal Renko" slug: "hal-renko" taxonomy: "indiv" url: "http://localhost/indiv/hal-renko/" - name: "Sam Edwards" slug: "sam-edwards" taxonomy: "indiv" url: "http://localhost/indiv/sam-edwards/" genre: - name: "Game" slug: "game" taxonomy: "genre" url: "http://localhost/type/game/" media_type: "Program" programmers: - name: "Hal Renko" slug: "hal-renko" taxonomy: "indiv" url: "http://localhost/indiv/hal-renko/" - name: "Sam Edwards" slug: "sam-edwards" taxonomy: "indiv" url: "http://localhost/indiv/sam-edwards/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Galactic%20Monsters%20(198x)(Renko%2C%20H%3B%20Edwards%2C%20S)(TS2068)(US)(Program).zip" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2026/09/galactic-monsters-1.png" - url: "http://localhost/wp-content/uploads/2026/09/galactic-monsters-2.png" media_type_tags: "Game" --- # Galactic Monsters Galactic Monsters is a real-time evasion game in which the player pilots a spaceship through the “Van Allen Square Stone Belt,” steering with keys 5–8 while avoiding eleven pursuing monsters. Three custom UDG characters are defined via DATA statements and POKE USR: a monster sprite (“p”), a blank/erase tile (“q”), and the player’s ship (“r”). Monster movement combines random wandering with a homing behavior governed by a probability variable (`chance`) that increases each time the player clears a wave, making successive waves progressively harder. Scoring subtracts the number of completed turns and a penalty proportional to collisions from a base value, rewarding swift, clean runs. *** ### Program Structure The program is organized into four logical regions: 1. **Introduction (lines 5–81):** Displays story text and waits for a keypress using the `INKEY$` polling loop at lines 79–81. 2. **Initialization subroutine (lines 800–900):** Called once via `GO SUB 800` at line 90; sets up arrays, zeroes counters, and loads the three UDG definitions. 3. **Main game loop (lines 100–440):** Outer wave loop at line 100, player movement and collision detection at lines 300–440, monster movement subroutine at lines 500–670. 4. **Data and save (lines 1000–1100):** UDG pixel data in binary literals, followed by a brief loop that prints “0” 100 times (apparently a delay/test artifact), and a `SAVE` with auto-run. ### UDG Sprite Definitions Three UDG characters are loaded from `DATA` at lines 1000–1020 using the pattern `FOR i=0 TO 7: READ fig: POKE USR "x"+i, fig: NEXT i`: | UDG | Role | Lines | | --- | --- | --- | | `"p"` | Monster sprite | 850, 1000 | | `"q"` | Blank/erase tile (space fill) | 860, 1010 | | `"r"` | Player’s ship | 870, 1020 | The “q” UDG (erase tile) consists entirely of `BIN 01111110` rows — a solid block used to overwrite a character position, effectively erasing it before redrawing at a new position. ### Wave and Scoring Mechanics Each wave places eleven monsters along row 13 (columns 10–20) and the player’s ship at position (6,15). The player must reach row 17 (`x1=16` triggers `GO TO 100`) to complete the wave. The score formula at line 160 is: `scor = scor + num - turn - 5*k` where `num` grows by 20 each wave, `turn` counts steps taken, and `k` counts collisions. This rewards speed and collision avoidance simultaneously. After four collisions (`k>4`), the game ends via `GO TO 700`. ### Monster AI and the Homing Probability The monster movement subroutine (lines 500–670) runs for each of the eleven monsters per game tick. For each monster, it first erases the old position, then decides movement: - If `RND < chance`, the monster enters homing mode (lines 590–610): it computes the delta to the player (`x2`, `y2`) and moves one step toward the player using `SGN`, choosing the x-axis 20% of the time and y-axis 80% of the time. - Otherwise, it picks a random direction (0–3) via a computed `GO TO` at line 530 (`GO TO 540+a*10`), moving one cell in that direction while clamping to the play-field boundaries. `chance` starts at 0 and increases by 0.1 each wave (line 280), so by wave 10 monsters home perfectly on every tick, creating escalating difficulty. ### Key BASIC Idioms - **Boolean arithmetic for movement:** Lines 350–360 use expressions like `x1 + (t$="6") - ((t$="7") AND (x1>6))`, exploiting the fact that boolean expressions evaluate to 1 (true) or 0 (false) to handle movement and boundary clamping in a single statement. - **Computed GO TO:** Line 530–580 use `GO TO 540+a*10` to dispatch to one of four direction-handling blocks, a common space-saving idiom. - **Double-draw of monsters:** Lines 640–660 redundantly redraw all monsters after the loop at 500–630 already drew them. This appears to be intended to reinforce visibility but is functionally redundant. ### Bugs and Anomalies - **DATA typo at line 1020:** The value `BIN 00q11100` contains the character “q” mid-literal, which is invalid. This would cause a syntax or runtime error when the DATA line is read. The intended value is likely `BIN 00011100` or `BIN 00111100`. - **Array dimension mismatch:** Line 810 declares `DIM x(12)` and `DIM y(12)` (12 elements), but the game uses indices 1–11. The extra slot is harmless but unused. - **Stray delay loop at line 1099:**`FOR i=1 TO 100: PRINT AT 10,10;"0";: NEXT i` prints “0” repeatedly — almost certainly a leftover test or debug fragment that executes before the `SAVE`. - **Boundary check inconsistency:** Player movement down is triggered by `t$="6"` with no lower boundary guard (player can move to row 16 which triggers wave completion), while upward movement is guarded by `x1>6`. The asymmetry means the player cannot accidentally leave the top of the belt but can intentionally complete a wave by moving down. - **Score can go negative:** If `turn + 5*k > num`, the score formula produces a negative contribution. No clamping is applied. ## Source Code ``` 5 REM Galactic Monsters 10 PRINT AT 5,5;"GALACTIC MONSTERS"; TAB 0;" " 15 PRINT " You are attempting to cross the Van Allen Square Stone Belt where the Galactic Monsters are known to dwell." 20 PRINT " To control your spaceship, you will utilize the direction arrows above keys 5 thru 8." 25 PRINT " You have no defenses against the monsters. Your only hope of survival is to avoid them as youguide your ship through the beltto complete your mission." 30 PRINT TAB 0;" "; TAB 3;"PRESS ANY KEY TO TAKE-OFF" 79 LET z$= INKEY$ 81 IF z$="" THEN GO TO 79 89 CLS 90 GO SUB 800 100 FOR t=1 TO 11 110 FOR z=1 TO 11 120 PRINT AT 5+t,9+z;"\q" 130 NEXT z 140 NEXT t 150 IF k>4 THEN GO TO 700 160 LET scor=scor+num-turn-5*k 170 LET num=num+20 180 LET turn=0 190 BEEP .5,3 200 FOR t=1 TO 11 210 PRINT AT 13,9+t;"\p" 220 NEXT t 230 PRINT AT 6,15;"\r" 240 LET x1=6:LET y1=15 250 FOR t=1 TO 11 260 LET x(t)=13:LET y(t)=9+t 270 NEXT t 280 LET chance=chance+.1 290 BEEP .2,1 300 IF k>4 THEN GO TO 700 310 PRINT AT x1,y1;"\q" 320 LET turn=turn+1 330 LET t$= INKEY$ 350 LET x1=x1+(t$="6")-((t$="7") AND (x1>6)) 360 LET y1=y1+((t$="8") AND (y1<20))-((t$="5") AND (y1>10)) 370 PRINT AT x1,y1;"\r" 380 FOR t=1 TO 11 390 IF ((x1=x(t)) AND (y1=y(t))) THEN BEEP .5,1:BEEP .5,2:LET k=k+1 410 NEXT t 420 IF x1=16 THEN GO TO 100 430 GO SUB 500 440 GO TO 300 500 FOR t=1 TO 11 510 PRINT AT x(t),y(t);"\q" 520 IF RND6):GO TO 620 560 LET y(t)=y(t)+(y(t)<20):GO TO 620 570 LET y(t)=y(t)-(y(t)>10):GO TO 620 580 GO TO 620 590 LET x2=x1-x(t):LET y2=y1-y(t) 600 IF RND>.8 THEN LET x(t)=x(t)+ SGN (x2):GO TO 620 610 LET y(t)=y(t)+ SGN (y2) 620 PRINT AT x(t),y(t);"\p" 630 NEXT t 640 FOR u=1 TO 11 650 PRINT AT x(u),y(u);"\p" 660 NEXT u 670 RETURN 700 CLS 705 PRINT AT 10,0;"THIS IS THE END OF THIS GAME" 710 PRINT AT 12,6;"YOUR SCORE IS ";scor 720 STOP 800 REM Init 810 DIM x(12):DIM y(12) 820 LET chance=0:LET scor=0 830 LET turn=0:LET k=0 840 LET num=0 850 FOR i=0 TO 7:READ fig:POKE USR "p"+i,fig:NEXT i 860 FOR i=0 TO 7:READ fig:POKE USR "q"+i,fig:NEXT i 870 FOR i=0 TO 7:READ fig:POKE USR "r"+i,fig:NEXT i 900 RETURN 1000 DATA BIN 00000000, BIN 01100110, BIN 01000010, BIN 00011000, BIN 00011000, BIN 01000010, BIN 00111100,0 1010 DATA 0, BIN 01111110, BIN 01111110, BIN 01111110, BIN 01111110, BIN 01111110, BIN 01111110,0 1020 DATA BIN 00111100, BIN 01011010, BIN 10011001, BIN 00q11100, BIN 10011001, BIN 00111100, BIN 00100100, BIN 01100110 1099 FOR i=1 TO 100:PRINT AT 10,10;"0";:NEXT i 1100 SAVE "GALAXY" LINE 0 ```