Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. MovePlayersUp:
  2. LDA UpHeld
  3. CMP #$01
  4. BNE .End
  5. LDA SpriteDirection
  6. CMP #$01
  7. BEQ .End
  8. LDA #$01
  9. STA SpriteDirection
  10. LDA $0300
  11. STA TempLocationY
  12. JSR MoveCharacter
  13. .End:
  14. RTS
  15.  
  16. MoveCharacter:
  17. LDA SpriteDirection
  18. CMP #$01
  19. BEQ .MoveUp
  20. RTS
  21. .MoveUp: ;;SpriteDirection is #$01
  22. LDA TempLocationY
  23. SEC
  24. SBC #$10 ;;If TempLocationY-16=$0300, you've made it 16 pixels!
  25. CMP $0300 ;;if so, reset. movement is done.
  26. BEQ .Reset
  27. LDA $0300 ;;if not, move up one pixel per frame
  28. SEC
  29. SBC #$01
  30. STA $0300
  31. RTS
  32. .Reset:
  33. LDA #$00
  34. STA TempLocationY
  35. STA TempLocationX
  36. RTS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement