Advertisement
Akianzax

AR3 ~ Diagonal Move

Jul 1st, 2014
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.65 KB | None | 0 0
  1. #                            ~ Akian~RGSS3 ~
  2.  
  3. # Nombre del script: AR3 ~ Diagonal Move
  4. # Scripter: Akian~RGSS3
  5. # Requiere?: -
  6. # Versión: 1.0
  7.  
  8. # Permite el simple movimiento en diagonal en el mapa que por defecto RMVXA
  9. # no tiene
  10.  
  11. $imported = {} if $imported.nil?
  12. $imported["AR3_Diagonal_Move"] = true
  13.  
  14. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. # Game Character
  16. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  17. class Game_Player < Game_Character  
  18.   #--------------------------------------------------------------------------
  19.   # ▼ Proceso de movimiento por Input
  20.   #--------------------------------------------------------------------------
  21.   def move_by_input
  22.     return if !movable? || $game_map.interpreter.running?
  23.     case Input.dir8
  24.     when 2,4,6,8
  25.       move_straight(Input.dir4)
  26.       when 1
  27.         move_diagonal_ar(4, 2)
  28.       when 3
  29.         move_diagonal_ar(6, 2)
  30.       when 7
  31.         move_diagonal_ar(4, 8)
  32.       when 9
  33.         move_diagonal_ar(6, 8)
  34.       end
  35.     end
  36.   #--------------------------------------------------------------------------
  37.   # ▼ Nuevo metodo de movimiento en diagonal
  38.   #--------------------------------------------------------------------------
  39.   def move_diagonal_ar(x, y)
  40.     move_diagonal(x, y)
  41.     return if moving?
  42.     move_straight(x)
  43.     move_straight(y)
  44.   end
  45. end
  46. #===============================================================================
  47. #
  48. #                 ▼ Fin del mundo, acá se acaba todo
  49. #                         ~  Akián RGSS3 ~
  50. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement