Gilbertmaxter
Member
Not sure if this has been shared or not.
So here is the code that lets me control the movements of monsters for chrono knight.
So here is the code that lets me control the movements of monsters for chrono knight.
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Directions
; to use with movement byte.
; These pertain to actual physics inertia,
; not facing directions.
;DOWN = #%00110000
;UP = #%00100000
;LEFT = #%10000000
;RIGHT = #%11000000
;DOWNRIGHT = #%11110000
;UPRIGHT = #%11100000
;UPLEFT = #%10100000
;DOWNLEFT = #%10110000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Facing direction, for animation engine.
;; These determine which facing direction the sprite uses.
;FACE_DOWN = #%00000000
;FACE_DOWNRIGHT = #%00000001
;FACE_RIGHT = #%00000010
;FACE_UPRIGHT = #%00000011
;FACE_UP = #%00000100
;FACE_UPLEFT = #%00000101
;FACE_LEFT = #%00000110
;FACE_DOWNLEFT = #%00000111
TXA
STA tempA ; object
JSR doGetRandomNumber
AND #%00000111
TAY
StartMoving tempA, #%00100000 , #$00 ; SET TO UP
ChangeFacingDirection tempA, #%00100000 ; SET TO FACE UP