CutterCross
Active member
8 directional movement is actually really easy to set up. All of the movement code is already set up under the hood (which I'm assuming is left over from Mystic Searches). All you have to do is set up the StartMoving macro.
All of the movement arguments can be found in Constants.asm, starting on line 97:
So for adding diagonal directions, just add and assign these scripts to the proper inputs.
Start Movement:
(You don't actually NEED these next scripts for stopping movement if you already set up your standard StopMoving scripts for Up, Down, Left, and Right, but I'll post them here anyway.)
Stop Movement:
So yeah, this is pretty simple. Makes me wonder why Joe never just gave us these scripts seeing as they're so easy to set up.
*EDIT: Accidently used "StartMoving" in the StopMoving diagonal scripts. Now they should all be correct.
All of the movement arguments can be found in Constants.asm, starting on line 97:
Code:
MOVE_RIGHT = #%11000000
MOVE_LEFT = #%10000000
MOVE_DOWN = #%00110000
MOVE_UP = #%00100000
MOVE_RIGHT_DOWN = #%11110000
MOVE_LEFT_DOWN = #%10110000
MOVE_RIGHT_UP = #%11100000
MOVE_LEFT_UP = #%10100000
STOP_RIGHT = #%01111111
STOP_LEFT = #%00111111
STOP_UP = #%11001111
STOP_DOWN = #%11011111
STOP_RIGHT_DOWN = #%01011111
STOP_LEFT_DOWN = #%00011111
STOP_RIGHT_UP = #%01001111
STOP_LEFT_UP = #%00001111
So for adding diagonal directions, just add and assign these scripts to the proper inputs.
Start Movement:
Code:
;;;; Start moving Down+Right ;;;;
StartMoving player1_object, MOVE_RIGHT_DOWN
RTS
Code:
;;;; Start moving Down+Left ;;;;
StartMoving player1_object, MOVE_LEFT_DOWN
RTS
Code:
;;;; Start moving Up+Right ;;;;
StartMoving player1_object, MOVE_RIGHT_UP
RTS
Code:
;;;; Start moving Up+Left ;;;;
StartMoving player1_object, MOVE_LEFT_UP
RTS
(You don't actually NEED these next scripts for stopping movement if you already set up your standard StopMoving scripts for Up, Down, Left, and Right, but I'll post them here anyway.)
Stop Movement:
Code:
;;;; Stop moving Down+Right ;;;;
StopMoving player1_object, STOP_RIGHT_DOWN
RTS
Code:
;;;; Stop moving Down+Left ;;;;
StopMoving player1_object, STOP_LEFT_DOWN
RTS
Code:
;;;; Stop moving Up+Right ;;;;
StopMoving player1_object, STOP_RIGHT_UP
RTS
Code:
;;;; Stop moving Up+Left ;;;;
StopMoving player1_object, STOP_LEFT_UP
RTS
So yeah, this is pretty simple. Makes me wonder why Joe never just gave us these scripts seeing as they're so easy to set up.
*EDIT: Accidently used "StartMoving" in the StopMoving diagonal scripts. Now they should all be correct.