Lobster Soup (ZX Spectrum) by IvanBasic
A downloadable game
Lobster Soup – by IvanBasic, for 10-Liners BASIC contest 2023
System: Sinclair BASIC (exclusively 48K mode)
Category: WILD
The story: In the mid 80´s, a missionary had to survive in the Savannah, catching the local cannibals to make soup with them. The news appeared on the specialized papers. But one day, a plague of red killer lobsters appeared on the village and devoured all the inhabitants, putting the bones in scattered piles across the village. So the missionary decide to take revenge on those monsters who devoured his own food, capturing them and making lobster soup. After watching them for a few days, he noticed that the killer lobsters became inoffensive for a few seconds in regular periods, turning their colour into blue as the sign of their temporary vulnerability. The plan was easy: to walk around the village looking for the 10 lobsters, and catching them in the instant they turn into blue. But it is a big risk, because the lobster will go back to red very quickly, biting the man and taking part of his blood. This game is inspired in a great BASIC type-in game published in the MicroHobby Magazine, called “Caníbales” (Cannibals) aka “Sopa de Caníbales” (Cannibals Soup).
How to play:
Use O-P-Q-A to move left-right-up down. Explore the 36 screens of the village, limited by the light-yellow borders. Look for the 10 lobsters, once you have captured them, the village will be cleared and the mission is accomplished. To grab a lobster, touch it when it turns into blue. If you lose all your blood (11 bites) you will start again in the first screen in the same village. If you clear the village, the game generates a new map of a village, to start a new mission. To run the game: Use LOAD “” in any Spectrum emulator, mode 48K, the program starts by itself. If you want to BREAK it at any time, to reset the game type RUN 1000. At the beginning, the map generating routine will last 36 seconds, so be patient and meanwhile enjoy the ROM checking …
Game features:
This game is inspired in a great BASIC type-in game published in the MicroHobby Magazine, called “Caníbales” (Cannibals) aka “Sopa de Caníbales” (Cannibals Soup), in which you have to explore the jungle to find the cannibals and grab them, avoiding the animals that try to kill you. Cannibals will escape from you, while the animals will pursue you. Due to the limitations of a 10-liner code, I had to gather both features in just one enemy, the lobster, which will pursue and bite you, but at the same time can be caught and eaten by you. About the map, it is created at the beginning of the game, putting 5 random blocks for each screen, but I managed to make some fixed zones such as north-west tree area, north-east water spots, huts and bone piles in the middle of the village, and a rocky area in the south. This map generation lasts 36 seconds as explained above. Storing each screen in an alphanumeric matrix p$(6,6,200), makes a quick print of each screen when moving across the map. It has 6x6 strings (36 screens), 200 char length containing the blocks (trees, huts, bones, water, rocks). I added another feature which I like very much from the game “Saimazoom”, this is, the multicolour static fade in of the enemy when it appears, and then starts moving. This causes the motor to be a little slower, but I think it is worthy for the aesthetics of the game. The melody when grabbing a lobster comes from Montezuma´s Revenge (aka Panama Joe), I used it in other game of my own, Pedro Pomez, just arranging the right duration of the notes. The sound of the bite is the same I use in many games, “designed” in the Pedro Pomez game as a door slam, but I think is great for kicks, hits, bites, and so on (I used it in Micro Profanation as well).
The code:
The program has two different parts:
1/ Set up of map and graphics (lines 1000-1020-1040) and
2/ Game motor (lines 200-201-202-203-204-230) + screen printing (line 500).
1/ Map and graphics set up
Line 1000 Sets the system variables for keyboard, general screen colours, and starts creating the map, defining first the graphic blocks in the string matrix b$(15,2,20), in which the first coordinate is the number of the block (15 blocks = 3 blocks x 5 types -tree, water, bones, huts, and rocks-), and each block has two rows (dimension 2), and max length 20 characters. Then, in two loops p and q for the 6x6 map, 5 blocks are put in the screen, storing their coordinates as CHR$ 22+CHR$ row+CHR$ column; this feature of Sinclair BASIC makes a PRINT AT row, column as a part of the string. This way, each screen stored in p$(6,6,200) is a 5-block layout, which is printed instantly.
Line 1020 Contents the graphic blocks DATA, including embedded colour codes, 5 types x 3 blocks each. Line 1040 Second part of the loops for creating the map, and setting the position of the 10 lobsters randomly (loop n). UDG are created in this line, with the DATA attached; and finally, the main variables are set as READ-DATA. Prints the scoreboard and starts the game jumping to line 500.
2/ Game motor and screen printing
Line 200 Prints the lobster, using logical functions to define the colours of PAPER (static fade in, or moving), and INK (red or blue). The change between red and blue is set reading the internal clock (PEEK 23672). This line reads the keyboard for moving the missionary using PEEK 23560. Changing the value of the CODE which k compares to, the player can define the own keys. Reading ATTR, the screen border can be detected, going to line 500 for printing the new screen.
Line 201 Using ATTR it detects if a blue lobster was caught, in this case the counter increases and checks if it is 10, so the mission was accomplished, jumping to line 1000 to reset the map and start again.
Line 202 Detects a collision for the missionary, this is, if the next step is not yellow this means an obstacle, so he does not move (new y,x coordinates are set as previous i,j).
Line 203 Prints the missionary, and makes the move of the lobster according to difference between coordinates y,x (missionary) and u,v (lobster). Checks if the lobster has touched the missionary, decreasing blood; if zero then the variables are set to start a new go, returning to the first screen, with the same map and lobster distribution (loop n).
Line 204 Identical to line 202, in this case for the lobster; if there is an obstacle, the lobster stays in the last coordinates s,t.
Line 230 Loop to line 200. This so short line is a luxury in a 10-Liner, but I couldn´t manage it better.
Line 500 Erases the screen setting all positions in yellow INK+PAPER (a trick with the LPRINT command), prints the screen blocks p$(p,q), and draws the limits of the screen. For the border of the village it sets BRIGHT yellow (visible), and for the limit of the screen FLASH yellow (invisible when using same INK and PAPER). This way of erasing and drawing the screen allows a very quick screen change when crossing the map. Reads if there is a lobster or not in this screen, using variable z and PEEK 60001 (screen 1-1) to 60036 (screen 6-6). Sets the initial position of the lobster, and jumps to game motor in line 203 (to print the missionary first of all).
List of variables
a – Sprite frame for the lobster and the missionary.
b – Flag for calculating the block when defining the screen.
e – Score.
i, j – Last position of the missionary.
k – Flag for key code and ATTR attributes.
l – Number of lobsters eaten.
m, n – Flags for calculating new coordinates when changing the screen.
o – Blood remaining. Starts in 11.
p – Row of current screen, from 1 (top) to 6 (bottom).
q – Column of current screen, 1 (left) to 6 (right).
r – Flag for lobster state and its PAPER colour; 6 (yellow) means moving, 1 to 5 means static fade in.
s, t – Last position of the lobster.
u, v – Current position of the lobster.
x, y – Current position of the missionary.
z – Flag for reading if there is a lobster in a screen or not.
a$, c$ – DATA read for storing the graphic blocks.
b$(15,2,20) – String matrix storing 15 blocks x 2 rows per block, LEN 20 each.
d$ – Auxiliar string in blocks definition.
l$ – Used for defining the attributes when using LPRINT for erasing the screen.
p$(6,6,200) – Matrix for map storage in 6x6 screens, LEN 200 characters each, containing the 5 blocks. 59901 to 59936 – POKE/PEEK to set the position of the 10 lobsters in the 36 screens (1 or 0). 60001 to 60036 – POKE/PEEK mirror of lobster positions, to be set to 0 during the game.
Status | Released |
Author | BASIC 10Liner |
Genre | Action |
Tags | 8-Bit, basic, basic10liner, sinclair, ZX Spectrum |
Leave a comment
Log in with itch.io to leave a comment.