Advertisement
Guest User

Diagonal Moviment

a guest
Jan 30th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. #==============================================================================
  2. # • Diagonal Moviment
  3. #==============================================================================
  4. # Autor: Dax
  5. # Versão: 1.0
  6. # Site: www.dax-soft.weebly.com
  7. # Requerimento: N/A
  8. #==============================================================================
  9. # • Descrição:
  10. #------------------------------------------------------------------------------
  11. # Adicional a opção do personagem andar na diagonal.
  12. #==============================================================================
  13. class Game_Player < Game_Character
  14. #--------------------------------------------------------------------------
  15. # • Processamento de movimento através de pressionar tecla
  16. #--------------------------------------------------------------------------
  17. def move_by_input
  18. return if !movable? || $game_map.interpreter.running?
  19. case Input.dir8
  20. when 2, 4, 6, 8 then move_straight(Input.dir4)
  21. when 1
  22. move_diagonal(4, 2)
  23. [4, 2].each { |i| move_straight(i) unless moving? }
  24. when 3
  25. move_diagonal(6, 2)
  26. [6, 2].each { |i| move_straight(i) unless moving? }
  27. when 7
  28. move_diagonal(4, 8)
  29. [4, 8].each { |i| move_straight(i) unless moving? }
  30. when 9
  31. move_diagonal(6, 8)
  32. [6, 8].each { |i| move_straight(i) unless moving? }
  33. end
  34. end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement