Trying to get a death block working on the Platform Module

So I found this code in the tileset scripts. I added it like this. Tile Collision 13-Routines\UserScripts\PlatformGame_Base\TileScripts\playerDeath.asm
Code:
CPX player1_object
	BNE isNotPlayerDeath_forTileCollision
	LDA Object_type,x

	JSR HandlePlayerDeath
	JMP donePlayerDeath_forTileCollision
isNotPlayerDeath_forTileCollision
	;;; if monster runs into spike
	DeactivateCurrentObject
	
donePlayerDeath_forTileCollision:

I've been fiddling around with it trying to get it working. When I change nothing the player just disappears and the game appears to keep running on the same screen, no player, no respawn. When I change things it most often prevents me from being able to compile and play it. One change I made, not sure what caused the player to stop moving and lose all inputs and was just stuck there like it was stuck in a solid. Can anybody dissect this code and figure out how to get it to be just a normal death block on the Platforming Module?
 

dale_coop

Moderator
Staff member
For the 4.0.6, I did that:

Code:
CPX player1_object
    BNE finishedPlayerDeathTile
 
    LDA player1_object
	CMP #$FF ;; this would mean he's dead.
	BEQ finishedPlayerDeathTile
	
	;;ELSE Player DEATH
    .include SCR_HANDLE_PLAYER_DEATH
    
finishedPlayerDeathTile:
 	RTS
 
oh my god, it was something I did in the HandleDeath scripts! I was trying to get rid of the jump in the air death and I guess I just messed up death altogether.
 
Now I cant seem to get rid of my player jumping into the air when it dies without really messing everything up. I just want it to stay where it is when it dies and play my awesome death animination without moving. My brain is so overwhelmed right now, I'm gonna make a damn fine cup of coffee. and I just realized I think the way the code is I think I need the dead player to touch the bottom bounds of the screen for death to end properly. So anyways, I'm gonna just deal with the bouncy death for now cuz I got death blocks working!! woohooo!
.
 

RadJunk

Administrator
Staff member
The problem is, there's no ONE way to do this. There are lots of ways to do these things. I just showed one.

The platformer module you have has gravity, so objects are going to fall. Unless you click the ignore gravity bit. Then they won't.

If you don't want the object to start moving up, you need to comment out the part of the code that gives that created object a vertical speed upon creation.

Hopefully that nudges you in the right direction :)
 
Top Bottom