KDLPro

Rollout Animation

Apr 26th, 2021 (edited)
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. BattleAnimFunction_Rollout:
  2. ; Modified version of AncientPower
  3. ; Object moves up and down in an arc for $20 frames and then disappear
  4.     call BattleAnim_AnonJumptable
  5. .anon_dw
  6.     dw .zero
  7.     dw .one
  8.    
  9. .zero ; right
  10.     ld hl, BATTLEANIMSTRUCT_VAR1
  11.     add hl, bc
  12.     ld a, [hl]
  13.     cp $20
  14.     jr nc, .done
  15.     inc [hl]
  16.     ld hl, BATTLEANIMSTRUCT_XCOORD
  17.     add hl, bc
  18.     inc [hl]
  19.     ld d, 12
  20.     call BattleAnim_Sine
  21.     xor $ff
  22.     inc a
  23.     ld hl, BATTLEANIMSTRUCT_YOFFSET
  24.     add hl, bc
  25.     ld [hl], a
  26.     ret
  27.    
  28. .one ; left
  29.     ld hl, BATTLEANIMSTRUCT_VAR1
  30.     add hl, bc
  31.     ld a, [hl]
  32.     cp $20
  33.     jr nc, .done
  34.     inc [hl]
  35.     ld hl, BATTLEANIMSTRUCT_XCOORD
  36.     add hl, bc
  37.     dec [hl]
  38.     ld d, 12
  39.     call BattleAnim_Sine
  40.     xor $ff
  41.     inc a
  42.     ld hl, BATTLEANIMSTRUCT_YOFFSET
  43.     add hl, bc
  44.     ld [hl], a
  45.     ret
Add Comment
Please, Sign In to add comment