Jake the Snake

Jake the Snake is a game for the Commodore 64.


The game is available for download here.


You are a snake. There are some apples nearby. Eat the apples to get to the next level. The game gets faster with every apple you eat and each level starts out with the speed of the snake being a little higher than the last. For a greater challenge, you can choose to increase both the minimum and maximum speed.


Jake the snake, a Basic game for Commodore 64

Version: 5.0
Release date: 2018-04-02
Author: Fredrik Ramsberg ( fredrik dot ramsberg at gmail dot com )

Playing the game
You are a snake. You need to eat all apples to get to the next level. You 
will face a number of levels, each with an increasing number of apples. Also,
speed will increase a little with every level you complete, and with every
apple you eat. You start with one life, but get an extra life after you've 
eaten 10 apples. You then get an extra life after eating another 20 apples
without dying, and then after another 30 apples etc.

You can choose your minimum speed and maximum speed. If you choose a minimum 
speed higher than 0, it means there won't be any speed increases at the 
beginning of the game. However, the maximum speed has to be higher than the 
minimum speed, so the speed will increase at some point during the game.

You can get a time bonus if you finish a level quickly. The time allowed
before the bonus is down to zero depends on how many apples there are to eat
and the speed of the snake on the lowest speed setting. Thus, you have the
chance to get a higher time bonus if you opt for a higher speed setting.

There are 36 different levels. If you play on Novice, you play all 36 levels.
If you complete level 36, you get to play level 1 again (but with higher speed
and more apples to eat than the first time around). If you play on Normal, you
skip the 12 easiest levels. So, you play level 13 to 36 and then go back to 
level 13 again. If you play on Expert, you skip the 24 easiest levels, playing
level 25 to 36 and then start over on level 25 again. Thus, Level 13 on Novice
is the same as level 1 on Normal, and level 30 on Novice is the same as level
18 on Normal and level 6 on Expert.

The snake grows more with every apple eaten on Normal than on Novice, and even
more on Expert. Also, the speed increase per level completed is higher on Normal 
and even higher on Expert.

I wrote this game to see if I could write an action game in pure C64 Basic, 
without machine code parts, without using a Basic compiler, and still make it
fast enough to be fun and challenging. After I got the game working, I spent 
dozens of hours optimizing the code for speed. Apart from getting the actual
game faster, this also involved making game startup, game restart, and all 
aspects of the menu screen faster, so that the game would be more enjoyable.

Since it is pure Basic, anyone can type LIST and see how things are done. 
Unfortunately, the speed optimizations are not helping readability. To assist 
people who are interested in how the game works, there is an  accompanying 
file containing code notes.


This game is released as freeware. Anyone is free to download it, play it, and
redistribute it in unchanged form, including this notice.

Additionally, anyone may use all or any part of the source code to create a
new program. If you do use any substantial part of the source code, please 
give credit.

Version history

Date		Version

2018-04-02	5.0	
	* Made level printing a *lot* faster.
	* Added three new levels. The game now has 36 levels.
	* Made menu screen more responsive. 
	* Made two levels (Expert#5 and Expert#12) slightly easier. 
	* Changed the layout of one level (Novice#11). This made it harder, so it
		was moved to a higher position (used to be Novice#7).
	* Changed the speed settings available to the player to make acceleration 
	* Changed the speed selection method. 
	* Changed the way the speed selection is displayed on menu screen.
	* Increased the minimum snake speed.
	* Changed the way the game waits for the player to press space after death
		or level complete, so player can press space before the	sound stops 
		playing, while other keys are ignored.
	* Some new informational messages.				

2018-03-27	4.1	
	* Fixed bug which could make the game freeze if you pressed keys just
		after dying or completing a level. 
	* Added an arrow pointing to your last result in the highscore list.

2018-02-17	4.0
	* Levels have been reordered, so harder levels come later in the game. 
	* Difficulty levels renamed to Novice, Normal, Expert. 
	* Game now default to Normal difficulty and the lowest speed settings 
		allowed (Min: 0, Max: 2). 
	* There are	now four apples in play at once instead of three.
	* Calculation of maximum time to get a time bonus now disregards speed 
		settings, which means you can get more time bonus on higher speed 
	* Bug in maximum time for time bonus calculation fixed. 
	* If the game fails to load highscores, it will now ask again about which
		unit to use. 
	* Fixed bug where the game would freeze after the snake dies. 
	* Fixed bug where you got 800000+ extra points when	playing past computer 
		time midnight. 
	* The speed increase per level completed is now half as big as before.
2018-02-04	3.0
	* Snake is a *lot* faster on maximum speed. 
	* Minimum speed has	been increased. 
	* Selectable speeds are now 0-4. 
	* Maximum speed is now selectable. 
	* Base speed and possible speed settings are now the same for all 
		difficulty levels.  
	* Game launch is quicker. 
	* Current speed is shown during game play (rounded down to integer). 
	* More speed is added per level completed than before.
	* Some informational messages have been improved. 
	* New name for highscore file, since highscores for this version shouldn't
		be compared with previous versions.

2018-01-23	2.2
	* Snake moves faster at maximum speed. 
	* Snake moves faster at minimum speed. 
	* Minimum speed settings are now 0-5. 
	* Game launches quicker. 
	* Game re-launches much quicker after game over. 
	* Snake grows more on medium and even more on hard. 
	* Better informational messages. 
	* Three new levels.

2018-01-16	2.1
	* Snake moves faster at maximum speed, and turns quicker.
	* Minimum speed settings are now 0-9 instead of 0-10.

2018-01-11	2.0
	* Added difficulty levels and minimum speed setting. 
	* Game remembers last name entered for highscore list.

2018-01-02	1.0
	* Initial release