diff options
| author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-07-02 23:30:21 -0400 |
|---|---|---|
| committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-07-02 23:30:21 -0400 |
| commit | f275790aec4a796ed969b099364abfdf25385967 (patch) | |
| tree | c56edfd01a61e9aa0e3c3ee8a046e66b5a1984e4 /engine/overworld/turn_sprite.asm | |
| parent | Actually run .travis/webhook.sh (diff) | |
| download | pokeyellow-f275790aec4a796ed969b099364abfdf25385967.tar.gz pokeyellow-f275790aec4a796ed969b099364abfdf25385967.tar.xz pokeyellow-f275790aec4a796ed969b099364abfdf25385967.zip | |
Add subdirectories to engine/ similar to pokecrystal
Diffstat (limited to 'engine/overworld/turn_sprite.asm')
| -rwxr-xr-x | engine/overworld/turn_sprite.asm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/engine/overworld/turn_sprite.asm b/engine/overworld/turn_sprite.asm new file mode 100755 index 00000000..c7f7712b --- /dev/null +++ b/engine/overworld/turn_sprite.asm @@ -0,0 +1,25 @@ +UpdateSpriteFacingOffsetAndDelayMovement:: + ld h, $c2 + ld a, [H_CURRENTSPRITEOFFSET] + add $8 + ld l, a + ld a, $7f ; maximum movement delay + ld [hl], a ; c2x8 (movement delay) + dec h + ld a, [H_CURRENTSPRITEOFFSET] + add $9 + ld l, a + ld a, [hld] ; c1x9 (facing direction) + ld b, a + xor a + ld [hld], a + ld [hl], a ; c1x8 (walk animation frame) + ld a, [H_CURRENTSPRITEOFFSET] + add $2 + ld l, a + ld a, [hl] ; c1x2 (facing and animation table offset) + or b ; or in the facing direction + ld [hld], a + ld a, $2 ; delayed movement status + ld [hl], a ; c1x1 (movement status) + ret |
