blimppilot
New member
I am following the platformer tutorial and am currently stuck on enemy placement. I want one enemy to go left and right and one enemy to go up and down. the code for the left and right came from the plaformer module. The up and down came from the adventure module. I am told that the labels are already defined and the lines of code are at 11 and 13 for the left and right and the code for the up and down monster is the same thing: same errors at the same lines. There is something I need to define and I don't know what that is.
;;;; Choose out of 2 directions.
; JSR GetRandomDirection
; AND #%00000110
JSR GetRandomNumber
AND #%00000001
BEQ isEvenNumberFor2WayDirection
;; is odd number for 2 way direction
LDA #%00000010 ;; right
JMP got2DirectionMovement
isEvenNumberFor2WayDirection:
LDA #%00000110
got2DirectionMovement:
TAY
LDA DirectionMovementTable,y
STA temp
TYA ;; the 0-7 value for direction
ORA temp
STA Object_movement,x
Thank you for any help you can provide!
;;;; Choose out of 2 directions.
; JSR GetRandomDirection
; AND #%00000110
JSR GetRandomNumber
AND #%00000001
BEQ isEvenNumberFor2WayDirection
;; is odd number for 2 way direction
LDA #%00000010 ;; right
JMP got2DirectionMovement
isEvenNumberFor2WayDirection:
LDA #%00000110
got2DirectionMovement:
TAY
LDA DirectionMovementTable,y
STA temp
TYA ;; the 0-7 value for direction
ORA temp
STA Object_movement,x
Thank you for any help you can provide!