Then what's the purpose of this EOR? Isn't it supposed to take care of the metatile width/height according to your own post in the linked thread? Player width/height is already accounted for in the code (currently hard-coded to 8 because the replacement graphics I'm currently using is a single 8x8 sprite at the moment) and works as it should.tokumaru wrote:Don't forget to account for the heights of the player and metatiles.Pokun wrote:The player teleports far above the ceiling whenever he bumps his head into it.
I tried skipping EOR and used AND instead but subtracted metatile height:
Negative Y-velocity (for ceilings) Ejection:
Code: Select all
@collision_solid_n:
lda #$00
sta p1_vy+0
sta p1_vy+1 ;stop velocity when banging head in ceiling
sta p1_y+0
lda p1_y+1
and #$0F
sec
sbc #$10 ;subtract metatile height
sta temp+1
lda p1_y+1
clc
adc temp+1
sta p1_y+1 ;eject from tile, Y = Y + (Y AND $0F) - metatile_h