pierski
New member
I am using the Scrolling Platform module. I want to make the powerup move up after it is collides with the player. The code below works fine for horizontal movements, if I change #UP to #LEFT or #RIGHT, but neither #UP nor #DOWN work. Any help is greatly appreciated.
Code:
LDA Object_flags,x
AND #%00100000
BNE +isPlayerPowerupCol
JMP +isNotPlayerPowerupCol
+isPlayerPowerupCol
JSR getOtherColBox
JSR doCompareBoundingBoxes
BNE +doCollision
JMP +skipCollision
+doCollision
TXA
STA otherObject
GetActionStep otherObject
CMP #$00
BEQ +flagNotTriggered
JMP flagTriggered
+flagNotTriggered:
;; There was a collision between a player and a powerup.
;; player is self.
;; powerup is other.
;; DestroyObject
StartMoving otherObject, #UP
PlaySound #sfx_powerup
ChangeActionStep otherObject, #$01
JMP +done
flagTriggered
+isNotPlayerPowerupCol