(4.5.9) Solid for only enemy tiles

gabeswarr

Member
Talking to some game designer friends, they mentioned something they used back in the day: solid tiles for only enemies. These would have no effect on the player, only the enemies.

I think this is something that we could all use with "reverse direction" solid object reaction to control enemy movement instead of using timers and action steps.

Has anyone attempted this yet? How would one go about such a feet?
 

SciNEStist

Well-known member
in the tile collision code, for whatever tile you decide to use you would add a check to see what type of object it is, this is done by looking at the object flags. the collided object is already "x" so here is what you would put:

Code:
LDA Object_flags,x ; load up the flags of object which is already x
AND #%00001000 ; check for a monster flag (#%00000010 is player for another example)
BEQ +isnotamonster ; if it's all 0, then the flag isnt checked, jump ahead
    ;PUT ALL THE TILE CODE HERE AND IT WILL ONLY APPLY TO MONSTERS
    ;FOR EXAMPLE, THE SOLID TILE CODE BELOW:
    LDA ObjectUpdateByte
    ORA #%00000001
    STA ObjectUpdateByte
+isnotamonster
;ANYTHING AFTER THE JMP WILL APPLY TO ALL OBJECTS AGAIN
 

SciNEStist

Well-known member
while horizontal collision is done with the tile scripts, vertical collision of tiles is handled by the physics script. Looks like you picked a tile to use that is solid in the physics script (the prize tile is something like #$07 and the regular solid tile #$01 )

you can either pick a different tile # to pop that code in, or alter your "Handle physics" subroutine.
 

dale_coop

Moderator
Staff member
Note, those are called "Monster block" in the context of nesmaker.
You can find them implemented, for example, in the Adventure module.

 

gabeswarr

Member
I'm finding that title 10 always performs as a ladder to spite what code you attach. I guess that's also a hidden tile type? Is there some kind of documentation for this?
 
Top Bottom