PATCH: The falling block

Completed patches for Keen1.
Post Reply
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

PATCH: The falling block

Post by levellord »

This is how the falling block works; When the chain is shot, a 3x9 grid of tiles appears in the level, 1 row of blck background, and the falling block. Rather than actually falling down, another 3x9 grid appears 1 tile down. This reases the old block leaving 2 rows of replaced tiles, then the block appears below again, etc.

Now the patches:

#Change the block tiles
%patch $23CD $DC $01 #top l corner
%patch $2436 $DD $01 #top middle
%patch $24B6 $DE $01 #top r corner
%patch $23EF $E9 $01 #bottom l corner
%patch $2458 $EA $01 #bottom middle
%patch $24D8 $EB $01 #bottom left

#Change the tiles the block leaves behind
%patch $23AB $9B $00 #left
%patch $2414 $9B $00 #middle
%patch $2494 $9B $00 #right


Tiles used [KeenRush] simple.


#Hitting chain restarts level
%patch $23F3 $06


Sprite property, other values, other things.


#Location of block right end, from chain, use $FF $FD for -ve values
%patch $2476 $04


The only one I could find. Technicaly then the end of the block can alter some tiles on the other side of the level, could be useful. Setting it to $03 shortens the block by 1 tile.

#tiles aren't replaced where block lands:
#Top left [But is replaced by bottom left of previous block]
%patch $23B7 $40
#Bottom left
%patch $23D9 $40
#Top middle
%patch $2420 $40
#Bottom middle
%patch $2442 $40
#Top right corner
%patch $24A0 $40
#Bottom right corner
%patch $24C2 $40


Careful, if top tiles aren't replaced, the bottom tiles will show through. This has the effect of making the block fall look a bit odd, and the end block have 2 bottom tiles instead of the top tile.

#Block falls 1 tile
%patch $24DC $04 $00
#Block keeps falling, right off the level
%patch $24ED $01
#Number of tiles block falls
%patch $24E8 $04


The first patch relies on code shown below. The second patch shorts the 'check how many blocks have fallen' subroutine, making the block fall forever. Very useful if you always want your block to fall to the level bottom all the time. The last patch is actually how many blocks will appear in th level, keep this in mind for the following code where the default value of 4 blocks can be changed.

#A block and 1 row of replacement tiles appear every 5 tiles, for 4 blocks
# $01 is normal [block erased by next block] change to $02, etc to change the
#distance between blocks
%patch $24DD $05

#A block and 1 row of replaced tiles appear every 8 tiles along, for 4 blocks
#change to $02, or larger to change the value of tiles along. $01 is normal
%patch $24DC $00
%patch $24DD $09


This takes explaining. There are 2 variables here; 1.) the numeric value, 2.) the mode. Mode $00 is 'move the block horizontal' mode $04 [default] is move the block vertical.

In the first patch, mode $04, we can changethe number of tiles the block 'falls' this means that the old blocks won't or will be only partially erased, but allows a block to 'teleport' through a floor:

#Block falls 5 tiles
%patch $24DD $05
#Only 1 block used:
%patch $24E8 $01


When the chain is shot, a block will appear 5 tiles down from the chain [with a row of replacement tiles too.]

In the second patch mode $00, the block 'falls' sideways, and again we can change the number of tiles it moves. It can only move right, and can only fall down. This allows of course, the use of the chain as a 'bridge builder, making a 3 tile high bridge as long as you desire.

We can now see that the 1 tile fall patch used earlier uses mode $04 and and tile difference of 0 tiles. All 4 blocks thus fall in the same place [1 tile down from the chain] and the block appears only to fall 1 tile.

Now we can teleport the block across the level, just like a bridge switch:

#Block teleports 16 tiles across
%patch $24DC $00 #set mode $00, across
%patch $24DD $10 #tiles to move
%patch $24E8 $01 #Only 1 block used


If we place the chain at the right side of the level and the tiles across value is large, it will go right across to the edge of the level and appear of the LEFT side of the level, 1 tile lower. Thus you CAN teleport a block to the left of Keen if you fiddle it right. [The block will lose 4 tiles goting through both level egdes.]

Enjoy!
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

Haha, this is crazy! :) Didn't know the block would allow all this.. That 'end level' property is interesting.
Edit: Hmmm, seems it doesn't even decrease lives.. It just restarts the level completely. :)

Other edit: Hmmm, I checked this one.. By changing the byte at 23F3, you aren't changing a value but an instruction. There is two byte value at the next address, however (23F4). The default value at 23F4 is $FD $FF. By changing that you get some strange effects, try

Code: Select all

%patch $23F4 $FA $EE
for example..
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

Post by levellord »

Ah, this is the 'location middle tiles will be placed to' value; being $FD $FF is a negitive number, the tiles start at $03 right of the chain and go back negitivly [left] to $FD $FF of the chain. Setting this to a positive number $03 $00 for example, lessens the number of middle tiles that appear:

#First 3 middle tiles left of chain don't appear
%patch $23F4 $00 $00

#None of the middle tiles appear
%patch $23F4 $04 $00

#The block is only 2 tiles wide, the left and right ends:
#Sadly appears 2 tiles left of chain
%patch $23F4 $04 $00
%patch $2476 $FD $FF

[Of course, this can be achieved by using the other patches above.]


BUT; thanks to KeenRush, I investigated this more thoroughly, and he's found the value I needed to overcome the problem I had last night. Thanks to him I can give you these:

Tiles not replaced:

#Left black tile
%patch $2395 $40
#Middle black
%patch $23FE $40
#Bottom black
%patch $247E $40


The position of block tiles within the falling block. [The black tiles have no value so immediately appear at $00]

#Top right tile vertical position
%patch $23B5 $01
#Bottom left tile vertical position
%patch $23D7 $02
#Top middle tile vertical position
%patch $241E $01
#Bottom middle tile vertical position
%patch $2440 $02
#Top right tile vertical position
%patch $249E $01
#Bottom right tile vertical position
%patch $24C0 $02


The location of various components of the block.

#Location of block left end from chain
%patch $238D $FC $FF
#Location of middle of block END from chain, number used =
#$FF $FF MINUS [blocks wanted - 5] here FD = FF - [8 - 5]
%patch $23F4 $FD $FF
#Location of block right end, from chain, use $FF $FD for -ve values
%patch $2476 $04 $00


Enjoy!
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

Heh, cool! We start to have complete control of the block. :)
Stealthy71088
Posts: 583
Joined: Thu Mar 17, 2005 11:54 pm
Location: NY

Post by Stealthy71088 »

now if i hadnt already used my dynamite 5 or 6 times in difficult to change ways... That block falling through the entire level would have allowed me to have the entire level blow up!

Is it possible to increase the number of bricks on either side the block drops? In otherwords, lengthen the block using the same tiles?
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

Post by levellord »

Yes, however, it can only be longer on the side LEFT of the chain.

First we relocate the left end of the block to where we want it to be:

#Location of block left end from chain is 2 tiles mORE left
%patch $238D $FA $FF #[= FC -2 =FA]


Now we extend the middle of the block:

#Location of middle of block END from chain, number used =
#$FF $FF MINUS [blocks wanted - 5] here FB = FF - [10 - 5]
%patch $23F4 $FB $FF


Now the block is 10 tiles long, but looks a little unbalanced so we can use this one off patch if we want:

#Block falls 6 tiles left of normal
%patch $2389 $00


And this introduces 2 other, final, patches for the falling block:

#When chain shot, no block falls
%patch $2389 $01

#Block falls rapidly
%patch $2389 $06


Enjoy!
Stealthy71088
Posts: 583
Joined: Thu Mar 17, 2005 11:54 pm
Location: NY

Post by Stealthy71088 »

Nice. Its too bad ive already used the block a half dozen times already- so i cant really play with that patch this time Next time perhaps i should think first about what patches i want to play with, and then the rest of the mod!
User avatar
Grandy02
Posts: 107
Joined: Tue Apr 19, 2005 2:26 pm
Location: Germany
Contact:

Post by Grandy02 »

Is it also possible that the block falls to left, to right or up instead of down?
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

Post by levellord »

Up: Nope, sorry.

Left-right:

We remember at the topic start:


#A block and 1 row of replacement tiles appear every 5 tiles, for 4 blocks
# $01 is normal [block erased by next block] change to $02, etc to change the
#distance between blocks
%patch $24DD $05
#A block and 1 row of replaced tiles appear every 8 tiles along, for 4 blocks
#change to $02, or larger to change the value of tiles along. $01 is normal
%patch $24DC $00
%patch $24DD $09


This takes explaining. There are 2 variables here; 1.) the numeric value, 2.) the mode. Mode $00 is 'move the block horizontal' mode $04 [default] is move the block vertical.

Right left: Nope again.
User avatar
Grandy02
Posts: 107
Joined: Tue Apr 19, 2005 2:26 pm
Location: Germany
Contact:

Post by Grandy02 »

Thank you! :-D I think, it will be useful for my mod...
Post Reply