********** SEEKING KEEN ********** This section deals with what makes sprites chase or seek out Keen, a large part of what makes them seem intelligent. Sprites usually seek Keen simply by moving right or left depending on whether he is right or left of them. There are usually two entries for this; +1 and -1 which reverse the speed of a sprite when it gets to one side of Keen. Thus about all you can do is edit these values. +1 is usually for right speeds, -1 ($FF $FF) for left. Setting any value to zero will make a sprite become still. So if say the +1 entry is set to 0, an Arachnut say, will be able to chase Keen left, but will be stuck behind an 'invisible wall' trying to chase him right. Setting both values to zero will make your sprite almost useless. Reversing both values will make a sprite 'fear' Keen; it will always try and stay as far away from him as possible. Reversing just one of the values means a sprite will try and get to one side of the level. (It will chase Keen left say, but if he jumps and it rushes past, it will keep heading left to get away from him.) Values other than -1, 0 and +1 will cause extreme difficulty, and even crashes. Sadly there is little way to make a seeking sprite ignore Keen totally, the best you can do is set its speeds to 0 and change it's animation speeds to make itmove back and forth. (Hey, I'm working on it, okay Andy?) Note that just because something doesn't seek Keen, doesn't mean it can't seem to; the Birds and Arachnutsfor example have a random compnent to their movement that means they can walk right into Keen by 'accident' rather than by chasing. However, stopping chasing certainly makes things easier. This section also deals with distances sprites measure; such as the Lick and Wormouth checking if they're close enough to flame or bite. ### #Arachnut ### #Walk towards Keen %patch $1058F $01 $00 %patch $10597 $FF $FF ### #Berkrloids ### #Berkeloids are interesting, they will randomly head toward Keen and when they are closer than about 5 #tiles, throw 4 times as many fireballs, *if* Keen is also no more than 1 tile above or below them. #Reversing the H distance check will make them throw more fireballs *only* when far away from Keen. (So #Long again as they are less than a tile above or below Keen.) #Turn and head towards Keen [Randomly] %patch $10C2D $FF $FF %patch $10C32 $01 $00 #V distance next to Keen to throw more fireballs: %patch $10C6D $00 $FF #-1 tile %patch $10C75 $00 $01 #+1 tile #H distance fiddle ($01, $00 or $FF only) %patch $10C86 $FF %patch $10C7C $01 #Ignore Keen behind Berkeloids %patch $10C1C $00 #Ignore Keen totally %patch $10C32 $FF $FF ### #Bird ### #When hatched, face Keen %patch $10082 $01 $00 %patch $1008D $FF $FF #When hatched, face Keen [Not used?] %patch $1011E $01 $00 %patch $10129 $FF $FF #Seek Keen on ground %patch $10210 $01 $00 %patch $10217 $FF $FF #Seek Keen while flying [h] %patch $10273 $01 $00 %patch $1027A $FF $FF #Seek Keen when flying [v]; reversing will often stick them into the ground %patch $1029D $FF $FF %patch $102B1 $01 $00 #Randomly change direction when can't get to Keen while flying %patch $1033D $FF $FF %patch $1036E $01 $00 #Height above birds before they fly after Keen %patch $10221 $00 $03 #Keen must be standing on ground ### #Bounder ### #When Keen is riding %patch $111D1 $40 $00 #How far left Keen must be on Bounder to %patch $111DB $FF $FF #Make Bounder move left %patch $111E7 $40 $00 #How far right Keen must be on Bounder to %patch $111F1 $01 $00 #Make Bounder move right %patch $111F8 $00 $00 #Otherwise move u/d #Ignore Keen %patch $111C0 $90 $90 ### #Dopefish ### #Head towards Keen %patch $1214D $01 $00 #H %patch $12154 $FF $FF %patch $12177 $01 $00 #V %patch $1218B $FF $FF ### #Inchworm ### #Head toward Keen %patch $10F86 $FF $FF %patch $10F8E $01 $00 ### #Lick ### #Head towards Keen %patch $1135C $FF $FF %patch $11363 $01 $00 #Max and min HEIGHT to flame Keen in: [tiles] %patch $1137D $00 $FF #Left (-1) %patch $11384 $00 $01 #Right (+1) #Max and min distance to flame Keen in: %patch $11395 $80 $01 #Left (+1.5) %patch $113A6 $00 $FE #Right (-2) #Amount to move back when flaming (To look nice, depends on sprite flaming length.) %patch $11390 $E0 #Left (= $00 - $20) %patch $113A1 $20 #Right (= $00 + $20) #How close to get before using short hops: %patch $113C9 $00 $03 #3 tiles ### #Mad Mushroom ### #Face Keen %patch $FF29 $FF $FF %patch $FF30 $01 $00 ### #Member ### #Initial direction 50/50 chance %patch $FD2F $FF $FF #l %patch $FD3A $01 $00 #r ### #Mimrock ### #Sneak after Keen if: %patch $11ECB $00 $05 #Less than 5 tiles above or below Keen AND, %patch $11EDF $00 $03 #Further than 3 tiles l/r of Keen #Sneak directions: %patch $11EEE $FF #If Keen is facing left, %patch $11EF4 $FF $FF #Mimrocks sneak left %patch $11F08 $01 #If Keen is facing right %patch $11F0E $01 $00 #Mimrocks sneak right #Jump on Keen if: %patch $11F2F $00 $05 #Less than 5 tiles above or below Keen AND, %patch $11F53 $00 $04 #Less than than 4 tiles l/r of Keen ### #Schoolfish ### #Normal %patch $12532 $01 $00 #Seek Keen h (l) %patch $12539 $FF $FF #Seek Keen h (r) %patch $1255C $01 $00 #Seek Keen v (u) %patch $12570 $FF $FF #Seek Keen v (d) ### #Smirky ### %patch $11AB4 $04 #If below a sprite of this type [Item] grab it %patch $11AD6 $00 $03 #Item must be lower than this [3 tiles] to be jumped %patch $11AF9 $01 #Smirky doesn't jump to get item tiles: %patch $11C62 $04 #Teleport to sprites with this property [Item] %patch $10CA6 $04 #Remove sprites with this property on collision [Item] %patch $11B53 $15 #Smirky jumps UP at tiles with property %patch $11B59 $1C #$15 to $1C [They run sideways into items by 'accident'] %patch $11D72 $15 #Grab tiles with property $15 to $1C %patch $11D78 $1C #[Tile prop 4-100 pts to 12-1UP] #Smirky stops hopping if next hop is more than this far over an edge: %patch $11BCD $00 $00 #Make -ve to mkae him jump off edges ### #Sprite ### #Shooting %patch $12627 $FF $FF #Shoot left if Keen left %patch $1262E $01 $00 #Shoot right if Keen right ### #Wormouth ### #Wormouth look left and right, if they see Keen when they look one way, they will head his way, #if they don't, they will look again and head EITHER right or left depending where he is. There #are thus 4 patches, 2 for when they see him 1st time, 2 for not. When biting the Worm checks #first if Keen is no more than 1 tile above or below it, THEN, depending on whether it is moving #left or right, how many tiles away it is. There is a close and a far limit, for example when #Moving right it can only bite if it is closer than 1.5, but further than 1 tile RIGHT (+!) of #Keen. (For left it is 1-2 tiles left (-) of Keen.) #Look %patch $10887 $01 $00 #Look right, see Keen, go right. %patch $108A7 $01 $00 #Look miss Keen, follow him %patch $108AF $FF $FF #Look miss Keen, follow him %patch $108CA $FF $FF #Look leftt, see Keen, go right. #Look %patch $108F6 $00 $FD #Look range, tiles, left (-3) %patch $108FC $00 $03 #Look range, tiles, right (3) #Bite %patch $10918 $00 $FF #Bite range, tiles, up (-1) %patch $1091F $00 $01 #Bite range, tiles, down (+1) %patch $1092B $80 $00 #Bite range, tiles, right (+1) %patch $10931 $80 $01 #Bite range, tiles, right (+1.5) %patch $1093D $80 #Bite range, tiles, left (-1) %patch $10942 $00 $FE #Bite range, tiles, left (-2)