Hiding a boss made with Bkg tiles upon death.

Working on a boss, and I have made it out of an enemy object for it's weakpoint and background tiles for the rest of its body.

When it dies, I want to hide all of the background tiles making up the boss, not just its weakpoint by destroying the enemy.

This is the code I made to try and do this:
Code:
bossKill:
    ;; Kill the boss, trigger the screen, and load any changed tiles
    ;; Destroy the boss
    LDA Object_x_hi,x
    STA temp
    LDA Object_y_hi,x
    STA temp1
    DeactivateCurrentObject
    CreateObject temp, temp1, #OBJ_MONSTER_DEATH, #$00, currentNametable
    PlaySound #SND_SPLAT
    
    ;; Add to the player's score

    ;; Get rid of the bosses background graphics
    ChangeAllTiles #$15, #$00, #$00 , #$00
    ChangeAllTiles #$15, #$00, #$00 , #$01
    
    ;; Trigger the screen
    TriggerScreen screenType

    JSR bossScreenTriggered

    RTS

It runs, destroys the boss, and triggers the screen, but it doesn't change any tiles.
Note that I have set all the bosses graphics to tileaction 15. The script for 15 is empty, the same as Null-walkable. Its just so that the boss graphics have their own collision type.
 
Can you assign the background tiles to be monster locks so that they disappear when the sprite monster part is destroyed?
 
Ok, with some tinkering around, I got that script to work.

Pretty pleased with the result, but I am having a minor issue.

Getting rid of the boss graphics leaves artifacts on the screen. Not sure how to clean that up.

EDIT: currently trying to attach a gif.
 

dale_coop

Moderator
Staff member
In your first post... if you used the "15 - boss tiles"... then it should be (#$0F in hex or #15 in decimal):
Code:
	ChangeAllTiles #$0F, #$00, #$00 , #$00
	ChangeAllTiles #$0F, #$00, #$00 , #$01
 
Ah yea, I figured out to change it to #$0F.

Its actually working and swapping the tiles like I want.

Just some 8x8 tiles are getting left behind somehow.
 
Top Bottom