Ice Cubes

Request patches for Keens 1-3.
Post Reply
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Ice Cubes

Post by CommanderSpleen »

I have this patch:

Code: Select all

#Icecube behaviour
%patch $20D6 $05 $00 #Push keen

#When icecube dies
%patch $213E $60 $33 #Do nothing
But it eventually crashes the game out. Some visual tile glitches start taking place, and then when the collision site enters the screen the whole game locks up.

This is likely because the sprites are not being deleted when they hit a wall, causing a memory leak.

Basically, the aim is:
- ice cubes push player like a yorp
- ice cubes do not disappear until they collide with a wall
- ice cubes do not spawn ice cubettes

Any ideas on how to do this in a memory friendly manner before I break out the disassembly?
Last edited by CommanderSpleen on Thu Jul 30, 2009 9:32 am, edited 1 time in total.
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

Interesting.

Code: Select all

# Icecube continues on its merry way while colliding with player
%patch $22A6 $C3
This solves the problem. (It replaces the above 'When icecube dies' patch).

It seems the function I pointed the death behaviour to does indeed do something, but out of context it can mess things up:

Code: Select all

:0001.3360 55                     push bp
:0001.3361 8BEC                   mov bp, sp
:0001.3363 5D                     pop bp
:0001.3364 C3                     ret
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Yes, a big problem with sprite patching (See our Yorp shooting post for another example.) the problem being that it's much too hard to explain, or even find out, the limits to all possible patches.
Post Reply