[solved] Collectable for the score.asm QUESTION (4.1.5)

Kajika

Member
Hello everyone,

I have a problem with a script : colectable for the score.asm

When i use it for my game, the tile disapear, but i don't know why, another apear....
i think the problem come from this line code:
Code:
+
    LDA #$01
    STA tileCollisionFlag
    ChangeTileAtCollision #$00 , #$19

the second value must be changed, but i don't know what value i can put...


Someone Can help me?

Thanks
 

AllDarnDavey

Active member
It's supposed to disappear... it's changing a coin (or whatever pickup you're using) tile into a background tile when your character walks over it.
ChangeTileAtCollision is a macro, and you can find more info on how it works by opening the file in system/macros.
Code:
MACRO ChangeTileAtCollision arg0, arg1
	; arg0 = metatile to change into
	; arg1 = collision to change into.

The first argument is the tile you want to change it to when interacting with it, the second arg is the collision to change into when interacting.
The default is:
Code:
ChangeTileAtCollision #$00, #$00
This means when colliding with this tile, change to tile 00 (first upper left most 16x16 block in the bank), and change collision to 00 (usually null walkable, or no collision).
If you want to make it change to a different tile change the first arg, to the topleft address of that tile, to change the collision change the second arg.

Edit:
Also you have the collision set to number 25, there's only 16 valid collision types usually. 00 - 0F
 

Kajika

Member
Thank you very Much AllDarnDavey

your answer allowed me to better understand the reasoning and I solved my problem.

regarding the number 19, in fact I had put it in order to make a different test and check the effects but indeed I knew the limit not to be exceeded
 
Top Bottom