Minecamp, The Next Mission

Minecamp started back in 2007, as an attempt to make something more interesting out of the classic Minesweeper style game. It was slightly inspired by "Desert Hunter" for PalmOS.
A few years later, I realized that the graphics were far from "decent". Just perhaps a bit better than what I used to do 20 years ago. So I set the goal to make them as good as I could, and also make some gameplay changes, inspired this time by Windows 10 Minesweeper's "Adventure mode".
Here is a link to download the game.
If you have never played a Minesweeper game before, here is a brief explanation on how to play:
You control the mine detector with your joystick, mouse o keyboard.
When you select a square, a number will tell you how many mines are in the 8 surrounding squares. If there are none, you can see how many mines are around those 8 squares.
If there is a mine in the location that you selected, the mine explodes and game over.
Once you are sure about the location of a mine, you can place a flag on it, to make keep you from accidentally blowing that mine.

In "Minecamp", once you have cleared a path to the end of the road - or if you are running out of time - you have to drive the truck to the destination. Be careful. Flagged mines will explode if run over.
Also, driving the truck out of the road will use time. Sometimes this is necessary to avoid a mine in the road. In those cases, consider that the time taken will depend on the terrain the truck is being driven over.
The enemy camp is in a single square surrounded by mines. Once you have located it, place the mine detector on its location and call for an air strike to destroy it. Any mines caught in the blast will be destroyed, making the square safe.
You can also use the air strike to simply destroy any mines in a region, creating a 3x3 safe area for your truck.
To win the game, simply make sure that the truck reaches the end of the road in every map.

THE GAME DISK

The files in the disk are:
MC2.BAS The game itself.
MINECAMP.SC1
MINECAMP.SC2 4 files with the intro image. The game graphics are loaded from this image.
MINECAMP.SC3
MINECAMP.SC4
GRAPHS.BAS The program used to create the graphics and save the SC files. Not needed to run the game.
MINECAMP.RGB The RGB color palette.
MINECAMP.CMP The CMP/TV color palette.
CONFIG.INI Stores the monitor and control configuration. If missing, an new one is created.
TEXTER.BAS The program used to create the Intro text file. Not needed to run the game.
INTRO.TXT Stores the text loaded during the game intro.
SCORES.DAT Saves the top 5 high scores. Can be deleted to reset the high scores.
XF.BAS A disk file manager. Not related to the game.


HACKING THE GAME

Being written completely in BASIC, Minecamp is easily hackable / customizable. Here are some pointers on what and how.

Changing the graphics:

When the program is started, it loads the intro screen from the MINECAMP.SC1-SC4 files and then HGETs most graphics from there, in lines 6000-6120.
The numbers shown in the map are defined in lines 6130-6210.
The cursor and the "flags" are DRAWn manually in lines 590 and 1540.

Changing the sounds:

There are not that many sounds in the game.
The explosion and the mine detector's sounds are defined in line 5660 and the tune played when the truck reaches its destination is in line 3180.

Changing the game:

The number of mines in each level is defined in line 200.
To have more air strikes available, change the AA variable in line 220.
The time available is defined in line 5530, based on the map level.
The number of maps in the game is calculated based on the difficulty level in lines 3520 and 3710.
And finally, the score is calculated in the routine from line 3500, based on number of mines flagged and left, remaining time, if the enemy camp was destroyed, and of course if the truck made it to the end of the road.

Speeding up the game:

it is possible to speed up the game a bit by removing the code used for some of the controls.
If you are only going to use the keyboard, then you can delete or comment lines 520, 530, 610 and 620.
If you just want to use the joystick or mouse, delete or comment lines 640, 650 and 660.

PROGRAM STRUCTURE:

I tried to keep the program flow kind of neat, but... this is old school BASIC.

From line 10: Load of the Intro image, call other initialization routines
From line 500: The main loop
From line 1000: Check if the selected square has a mine
From line 1500: Mark the square with a flag
From line 2000: Remove a flag from a square
From line 2500: Air strike
From line 3000: Drive the truck
From line 3500: Calculate score at the end of the level
From line 4000: Show the mines in the map
From line 4500: Explode a mine, and mark the game as over
From line 5000: End the game
From line 5500: Initialize variables, including map's content
From line 6000: Setup graphics
From line 6500: Show the map terrain and main screen
From line 7000: Place mines and the enemy camp
From line 7500: Text intro
From line 8000: Load/Create configuration and high scores
From line 8500: Exit the program

MISCELANEOUS STUFF:

RGB palette: 55,52,27,48,0,18,32,17,63,12,56,62
CMP palette: 52,37,46,20,0,18,23,17,48,11,32,63
Color list: 1 yellow, 2 orange, 3 light blue, 4 brownish, 5 black, 6 atomic green, 7 red, 8 green, 9 white, 10 purple, 11 grey, 12 pale yellow

HGET buffers:

Sand: 1-3
Road: 4-6
Rocks: 7-8
River: 9-10
Mine: 11
Truck: 13-15
Tent: 16
Explosion: 18-25
17 is used for screen buffer, and 12... is unused and a waste of memory, shame on me!

Map array content:

1 : Sand
4 : road
7 : rock
9 : river
14 : enemy camp
-111 : mine destroyed by air attack
Negative value indicates a mine. That is, -1 is a mine on sand, -9 is a mine on river.
Flags are indicated by adding 100 or -100. 104 is a flag on road, -109 is a flag on a mine on a river.

I guess that is all, or most of it at least.
I hope that you enjoy playing the game as much as I did writing it. Here is the link to download the game again.