I know that ive had that issue in nonscrolling 4.1.5. I think sometimes you are hitting 2 tiles, or you and an enemy are.
And since nesmaker doesnt handle collisions in the best way,that may be why.
But yes, it may have to do with the macro itself.
My example was mostly when shooting a projectile that interacted with some background tiles.
My tiles would turn from lava to ice.BUT sometimes the image would NOT change,even though the tile actually changed.
BUT also sometimes it completely missed the tile,and i could shoot again and change it.
Could be the speed in which youre interacting or changing stuff too. Like player speed.
Or the macro, or nesmaker's way of handling collisions or even/odd screens.
Could be you hitbox size...
Sounds like im no help,just wanted to give my input and bump this.
EDIT: Is it ever the same tile?
Try moving that tile to a different spot. Like 1 spot down and 1 spot right.
If i could play the demo and test,i could atleast see when its happeni
Ok... I can confirm that the collision changes to the right value. But sprite randomly ceases to change. Does anybody have a clue what might be happening here?
Maybe it has something to do with ChangeTileAtCollision?
Code:
MACRO ChangeTileAtCollision arg0, arg1
; arg0 = metatile to change into
; arg1 = collision to change into.
LDY temp1
LDA temp2
BEQ +isEvenCt
;; is an odd ct, so looking in collisionTable2
LDA arg1
STA collisionTable2,y
JMP +doneWithTileUpdate
+isEvenCt
LDA arg1
STA collisionTable,y
+doneWithTileUpdate
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; This part will actually update the tile with tile 0 in the tile set.
;;; ys is carried over from above.
;;; GET THE HIGH BYTE OF THE TILE TO CHANGE
LDA temp2
BEQ +isEvenNt
;; is odd nt
LDA #$24
JMP +gotNt
+isEvenNt
;; is even nt
LDA #$20
+gotNt
STA temp1
;;; GET THE LOW BYTE OF THE TILE TO CHANGE
TYA
STA temp
LSR
LSR
LSR
LSR
LSR
LSR
clc
ADC temp1
STA temp2 ;;;temp16+1
TYA
AND #%11110000
ASL
ASL
STA tempz
TYA
AND #%00001111
ASL
ORA tempz
STA temp3 ;temp16
;;; SET THE TILE NUMBER TO CHANGE TO.
LDA arg0 ;; the tile to change.
;;; this is in tiles, so if you wanted the second "metatile",
;;; use 2, not 1. If you wanted the tile in the next row,
;;; use #$20, not #$10. Etc.
STA tempA
CLC
ADC #$01
STA tempB
CLC
ADC #$0F
STA tempC
CLC
ADC #$01
STA tempD
LDY #$00
LDA temp2
STA scrollUpdateRam,y
INY
LDA temp3
STA scrollUpdateRam,y
INY
LDA tempA
STA scrollUpdateRam,y
INY
LDA temp2
STA scrollUpdateRam,y
INY
LDA temp3
CLC
ADC #$01
STA scrollUpdateRam,y
INY
LDA tempB
STA scrollUpdateRam,y
INY
LDA temp3
CLC
ADC #$20
STA temp3
LDA temp2
ADC #$00
STA temp2
LDA temp2
STA scrollUpdateRam,y
INY
LDA temp3
STA scrollUpdateRam,y
INY
LDA tempC
STA scrollUpdateRam,y
INY
LDA temp2
STA scrollUpdateRam,y
INY
LDA temp3
CLC
ADC #$01
STA scrollUpdateRam,y
INY
LDA tempD
STA scrollUpdateRam,y
INY
TYA
STA maxScrollOffsetCounter
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Turn on update screen on next frame.
LDA updateScreenData
ORA #%0000100
STA updateScreenData
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ENDM