Page 1 of 1

Moving Platforms can follow guided paths

Posted: Tue Jan 17, 2017 1:40 pm
by levellass
This patch alters the Horizontal-Vertical Platforms so that they can follow arbitrary paths; changing direction whenever they encounter a certain tile. As a side effect the Platform flames are not displayed, their code space is used for the patch. It's a bit rough, but someone might like it.

The first part of the patch removes the flames and calls the tile checking code, the second part of the patch. The first five lines check for tiles while the remaining code responds to special tile types. Four tile types are checked for, $0A-$0E, these are the 'water entrance' types used on the map but not in regular levels. Each type sets one of the Platform's horizontal ($0E) or Vertical ($10) directions to zero and the other to +/-1 ($0001W/$FFFFW)

Platforms using this patch will still reverse direction on encountering sprites. Unlike with sprites however, Platforms will react to tiles when their hitbox touches them, meaning that they will not always move in a nice, neat aligned manner. Also, unlike in Keen 5 Platforms do not need a tile on every part of their path; only where they should change direction. A Platform that 'misses' a tile will just keep going until it runs into a barrier, another turning tile, or sprite.

Code: Select all

#Remove flames- call plat-turn code
%patch $11792 $56 $9A $10800F9ERL     $83 $C4 $02 $E9 $0134W

#Tile interaction code =$10800FA5RL
%patch $1179E $55 $8B $EC $83 $EC $04 $56 $57 $8B $76 $06
              $8B $44 $34 $89 $46 $FE $8B $44 $28 $2B $44 $24
              $D1 $E8 $8B $54 $24 $03 $D0 $B1 $08 $D3 $EA $89 $56 $FC $8B $5E
              $FC $D1 $E3 $8B $9F $25 $C9 $D1 $EB $D1 $E3 $8E $06 $E9 $A7 $8B 
              $46 $FE $D1 $E0 $03 $D8 $26 $8B $1F $8E $06 $A1 $C8 $26 $8A $87
              $A6 $44 $B4 $00 $8B $F8 $83 $FF $0B $75 $0A $C7 $44 $0E $0000W
              $C7 $44 $10 $FFFFW  $83 $FF $0C $75 $0A $C7 $44 $0E $FFFFW  $C7
              $44 $10 $0000W  $83 $FF $0D $75 $0A $C7 $44 $0E $0000W  $C7 $44
              $10 $0001W  $83 $FF $0E $75 $0A $C7 $44 $0E $0001W  $C7 $44

              $10 $0000W  $5F $5E $8B $E5 $5D $CB

Re: Moving Platforms can follow guided paths

Posted: Tue Jan 17, 2017 10:03 pm
by Nisaba
I-N-T-E-R-E-S-T-I-N-G!
is it already in use?

Re: Moving Platforms can follow guided paths

Posted: Thu Jan 19, 2017 11:30 am
by levellass
I have a mod containing it, but it's not ready for release yet.