Patch:Sprites (Keen 1)
This page lists all the sprites in Keen 1, providing links to their pages. It also contains all the patches that apply to several sprites or cannot be placed under one of the main sprite pages. An extensive tutorial on sprite patching is available at Patch:Patching Vorticon Sprites. Patches that affect many sprites may also be under Patch:Keen (Keen 1) if they are not here.
List of Sprites
These are the sprites in Keen 1, each with their own pages of patches.
- Patch:Vorticon (Keen 1)
- Patch:Butler Robot
- Patch:Tank Robot
- Patch:Keen (Keen 1)
- Patch:Zap and zot
Add\Remove Sprites From the Game
This patch allows you to add as many different sprite types as you can find space for in Keen 1, if you can find code space for them. It also allows different patch files (Say Easy, Medium, Hard) to use the same levels and spawn more or less of an enemy, like in Keen Galaxy. First the default patch (No effect on the game) will be listed, then a tutorial where a new sprite is created.
This patch consists of a number of sections. The first is the core switch statement. This is a rewrite to give us space. It points to section 2, the sprite list. This list uses 10 sprites by default (1 more than the blue $09 in section 1) but it can hold up to 19 as-is. To add a new sprite change that blue value by 1
The second section shows the location of primary sprite code. It is in essence a list. To add a new sprite as a new $xxxxW value to the list. It has space for a maximum of 19 entries.
The third section is the primary sprite code. Notice that each line is located where it says in section 2. (The ice cube code is special.) There are two brown values per line, the second one always points to the same palce. The first one however jumps to the sprites secondary code and will have to be changed when adding new sprites.
The fourth section is the actual sprite spawning code that sets all the sprite variables. This is the last and largest section. What code is used depends on what needs to be set when the sprite is placed. All sprites need their behavior, death behavior, type, and animation set, otherwise they will crash. Different sprites may have their strength, speed and other variables set as well. Each spawn code has three brown values that will need to be adjusted when new sprites are added.
|Patch: Keen 1|
The sprite behavior and death code can be considered section 5 of such a patch; but this is even loner and more complex and is best detailed on each sprite's page. (A list of which can be found at the top of this page.)
This tutorial will show how the above patch can be used to add a new sprite, a second Butler Robot that moves at a different speed, to the game. The patch will be shorter than the one above as default lines do not need to be included. This patch, and all that are built on it is incompatible with all other $0AF2 using patches.
For this patch the free space at $0AF2-$0C50 will be used to store the sprite code. The first and second sections are vital. First we increase the number of possible sprites from $09 to $0A and add a new value to the second section, $0AF2W.
In section 3 we add a new line at that location to point to the new sprite spawning code. The first brown value is easy enough to calculate, our sprite spawn code will be at $0AFD ($0AF2 plus the 11 bytes of patch.) And $0AFD - $0AF2 - $5 = $6. The second brown value is harder, it must point to the same place as all others. To find its value here we take a value from a known location above (Say the Yorp, $008E at $1656) then add the 'old' location and subtract the 'new' location. (In this case $008E + $1656 - $0AF2 = $BF2, this is a larger jump, which makes sense since the patch is further away from the jump location than originally.)
For the sprite spawning code, a copy of the Butler Robot spawning code is used, since it does what we want (Setting a starting speed.) It is important the three brown values be changed in the same way we changed the second brown value in section 2. The sprite type is changed to 9, and the speed to $90 (Fast!) The new sprite will use the same animation anddeath as the original Butler Robot, but will use different behavior.
|Patch: Keen 1|