Patch:Dart Gun
The Dart Gun in Keen 4 is an invisible sprite that regularly spawns new sprites, or darts. There are four different varieties of gun (Though they are not different sprites in themselves.) that shoot in different directions. Similar sprites occur in Keen 3 and Keen 6, as well as in Keen 5 and the watermelons in Keen Dreams. this page also covers patches relating to the dart sprites produced.
Contents |
Sprite Type
Dart guns are type 1, specifically to avoid interactions with any other sprites. Darts are type 31, but this doesn't affect any sprites by default.
| Patch: Keen 4 |
|
Sprite Actions
There are four separate sets of actions relating to darts. The first is the dart gun. t remains as it is, running a 'make dart' code every time it animates. The remaining three are darts, horizontal, up and down. Each has two animation frames.
Actions: $3962W #Dart gun $3980W #Dart horizontal 1 $399EW #Dart horizontal 2 $39BCW #Dart up 1 $39DAW #Dart up 2 $39F8W #Dart down 1 $3A16W #Dart down 2
| Patch: Keen 4 |
|
Sprite Behavior
The only sprite with a behavior is the dart gun, and this behavior regularly produces one of the three dart sprites, setting their direction and other properties. Darts themselves do nothing.
Behaviors: $11A20EE6RL #Dart gun
| Patch: Keen 4 |
|
Speed and Jump Height
The Dart Gun doesn't move, as is expected. Darts move either horizontally or vertically by default, the direction of their movement being determined by the dart's direction below. Due to having different sprites, up and down darts have different speeds.
| Patch: Keen 4 |
|
Dart direction
The darts have their directions set on creation. That is, in what direction they'll move. Each dart can move both horizontally and vertically, or both at the same time. This is controlled by two variables, the horizontal and vertical direction, and whether they're right\down (1), left\up (-1) or still (0)
| Patch: Keen 4 dart directions |
|
Sprite Collision
The dart collisions are quite simple. The dart gun has no collision, it does not interact with other sprites. (Thus it cannot be destroyed, or hurt Keen.) The darts themselves use the 'misc lethal' collision, killing Keen if they touch him.
| Patch: Keen 4 collision values |
|
Animations
The dart animations are simple, darts have two animations and the dart gun is invisible. Note that the dart gun animation speed is also the frequency it produces darts.
The 'when spawned' sprites are used to position darts and should be the same as the first frame of the dart produced, otherwise your darts will be off-center.
| Patch: Keen 4 |
|
Sounds
The dart shooters make a sound each time they produce a dart. This sound can be blocked.
| Patch: Keen 4 |
|
Sprite positioning
The positioning of darts is poorly understood. The values are in pixels and two of the values are negative (Left or up)
| Patch: Keen 4 |
|
Clipping and foreground
The Dart Gun is given clipping of 0, that is, pass through tiles; possibly so it can shoot darts from walls. Darts do not appear to have clipping set.
| Patch: Keen 4 |
|
Sprite-tile interaction
Dart shooters do not interact with tiles, as expected. Darts use the 'enemy shot' interaction; they vanish when they hit a tile that blocks in any direction.
| Patch: Keen 4 |
|
Darts don't vanish when they hit tiles
This patch stops the darts vanishing when they hit solid tiles. They will however stop moving.) If nothing else is done they will rapidly build up and crash the game so some other manner of removing them must be used. (Darts destroy each other, vanish after a fixed time, exit the level... simply going offscreen will not work.)
| Patch: Keen 4 |
|
Darts smash like Keen's shots
This patch causes darts to smash into tiles just like Keen's shots, making the same noise and smashed shot sprite instead of just vanishing.
| Patch: Keen 4 |
|
Action type
Dart guns are type 0, they sit and do nothing. Darts are type 1, they move smoothly through the air.
| Patch: Keen 4 |
|
Deprotect and stick to ground
Darts and dart guns do not use either of these values since they have no interaction with sloped tiles at all.
| Patch: Keen 4 |
|
Sprite spawn code
There are four kinds of Dart shooter which are divided further into three different difficulties in the game. Notice that there are three initiation codes, one for each difficulty, instead of four; one for each type. In each initiation code notice the Dart cache being set ($C7 $06 $CB79W $0001W.) Finally notice that all three initiation codes go to the same spawning codes; that is where the different types of Dart shooter are differentiated.
| Patch: Location of initiation code |
%patch $EEED $0489W |
| Patch: Dart Gun Initiation code |
|