-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathmovementscript_commands.s
More file actions
48 lines (41 loc) · 1.22 KB
/
Copy pathmovementscript_commands.s
File metadata and controls
48 lines (41 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
; This is a barebones "scripting language" used for objects that move in a simple pattern.
; Non-interaction objects can use this, which is probably the only reason it exists.
;
; Used by ambi guards, sidescrolling platforms, some other things?
;
; An object can load such a script with "objectLoadMovementScript", and run it each frame
; with "objectRunMovementScript". It assumes that the object's states $08-$0b move
; up/right/down/left, respectively, and state $0c is for "waiting".
;
; Using this type of script reserves the object's var30/var31 to save the script's
; address. It also writes the Y-destination to var32, and the X-destination to var33.
; Used for looping patrols
.macro ms_loop
.db $00
.dw \1
.endm
; Parameter 1: Dest y-position
.macro ms_up ; Goes to state 8
.db $01 \1
.endm
; Parameter 1: Dest x-position
.macro ms_right ; Goes to state 9
.db $02 \1
.endm
; Parameter 1: Dest y-position
.macro ms_down ; Goes to state $0a
.db $03 \1
.endm
; Parameter 1: Dest x-position
.macro ms_left ; Goes to state $0b
.db $04 \1
.endm
; Parameter 1: counter1 (frames to wait)
.macro ms_wait ; Goes to state $0c
.db $05, \1
.endm
; Parameter 1: counter1
; Parameter 2: state to change to
.macro ms_state
.db $06, \1, \2
.endm