Patch:Melon Lips
Melon Lips are harmless green creatures that are found in dark, usually underground areas in several levels in Tuberia in Keen Dreams. They do not move but are dangerous as they will spit a deadly melon seed every five seconds. They can fire down, left and right, so there are three kinds.
Contents
Sprite Type
Melons use type 14 which has no impact on any other sprites. Pips use type 24 which affects how Keen reacts to it.
Patch: Keen Dreams |
|
Sprite Actions
The Melon has a simple, if extensive, set of actions. It is spawned in-level in its 'waiting' action which will, after a time go to its spitting action, where it will make a pip. After that it will go to a 'return' action that basically allows it to hold its spitting animations for a little while without making more pips. There are two types of melon, horizontal and vertical. The horizontal melons can be either left or right facing.
The pips have two actions in a perpetual cycle that lasts until a certain amount of time is up, when they vanish.
Actions: $1F9CW #Horizontal melon wait $1FBAW #Horizontal melon spit $1FD8W #Horizontal melon return $1FF6W #Down melon wait $2014W #Down melon spit $2032W #Down melon return $2050W #Horizontal pip 1 $206EW #Horizontal pip 2 $208CW #Down pip 1 $20AAW #Down pip 2
Patch: Keen Dreams |
|
Sprite Behavior
Behaviors: $07C501A4RL #Move through the air $086803CBRL #Melon spit pip
The Melon and pips have only one unique behavior; that used by Melons to produce pips (both horizontal and vertical.) The pips themselves use a general 'move through the air' behavior. Note that only one frame of the horizontal\vertical Melons use the behavior. Melons have no behavior while waiting to shoot or just after shooting.
Patch: Keen Dreams |
|
Speeds
The Melon's animation speeds are not used for anything, the sprite speeds are all set in game code.
Patch: Sprite speeds |
|
Sprite collision
Like nearly all sprites in Keen Dreams the Melon and pips do not have a sprite collision. Instead Keen and his shots react to them and their sprite types.
Patch: Keen Dreams |
|
Animations
Melon Lips come in two different types, each with their own animations. The pips come in two different types, again with their own animations. Each animation is quite simple.
Patch: Keen Dreams |
|
Sprite-tile interaction
The Melons do not interact with tiles in any way, their interaction code merely displays their sprites. The pips on the other hand will bounce off of floors an walls and both horizontal and vertical pips use the same code.
Patch: Keen Dreams |
|
Action type
While the melons themselves just sit and thus use type 0 actions, the pips are different. Horizontal pips don't animate but move smoothly and so are type 2. Vertical pips animate as well and so are type 3.
Patch: Sprite action types |
|
Deprotect and stick to ground
The Melons and their pips have no need for either of these variables and so have a value of 0 for both in all their actions.
Patch: Keen Dreams |
|
Sprite spawn code
There are three types of Melon lips. In their initiation code their cache is set in $C7 $06 $70CCW $0001W.
The last blue highlighted value is the sprite action the sprite uses as it proceeds to act in-level. $C7 $07 $xxxxW sets the sprite type, $C7 $47 $06 $xxxxW sets the |clipping, and $C7 $47 $0E $xxxxW is the horizontal direction the sprite starts moving in, either $0001W (Facing right), $FFFFW (Facing left) or $0000W (Neither, seldom used.) $C7 $47 $10 $xxxxW is the vertical direction and works similarly. The Broccolash spawns facing right.
Note that on line 5 a check is made of what type the melon is; if it is type 2 then the melon uses the vertical action. On line 3 a similar check is made that decides whether the horizontal melons will be left or right facing.
Patch: Keen Dreams |
|