Advertisement
Double_X

DoubleX RMVXA Diagonal Movement v1.00a

Aug 15th, 2015 (edited)
846
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 6.24 KB | None | 0 0
  1. #==============================================================================|
  2. #  ** Script Info                                                              |
  3. #------------------------------------------------------------------------------|
  4. #  * Script Name                                                               |
  5. #    DoubleX RMVXA Diagonal Movement                                           |
  6. #------------------------------------------------------------------------------|
  7. #  * Functions                                                                 |
  8. #    Lets users moves characters diagonally by pressing both component keys    |
  9. #------------------------------------------------------------------------------|
  10. #  * Terms Of Use                                                              |
  11. #    You shall keep this script's Script Info part's contents intact           |
  12. #    You shalln't claim that this script is written by anyone other than       |
  13. #    DoubleX or his aliases                                                    |
  14. #    None of the above applies to DoubleX or his aliases                       |
  15. #------------------------------------------------------------------------------|
  16. #  * Prerequisites                                                             |
  17. #    Abilities:                                                                |
  18. #    Nothing special                                                           |
  19. #------------------------------------------------------------------------------|
  20. #  * Instructions                                                              |
  21. #    1. Open the script editor and put this script into an open slot between   |
  22. #       Materials and Main, save to take effect.                               |
  23. #------------------------------------------------------------------------------|
  24. #  * Links                                                                     |
  25. #    Script Usage 101:                                                         |
  26. #    1. forums.rpgmakerweb.com/index.php?/topic/32752-rmvxa-script-usage-101/  |
  27. #    2. rpgmakervxace.net/topic/27475-rmvxa-script-usage-101/                  |
  28. #    This script:                                                              |
  29. #    1. http://pastebin.com/dySk8jkU                                           |
  30. #    Mentioned Patreon Supporters:                                             |
  31. #    https://www.patreon.com/posts/71738797                                    |
  32. #------------------------------------------------------------------------------|
  33. #  * Authors                                                                   |
  34. #    DoubleX                                                                   |
  35. #------------------------------------------------------------------------------|
  36. #  * Changelog                                                                 |
  37. #    v1.00a(GMT 0600 15-8-2015):                                               |
  38. #    1. 1st version of this script finished                                    |
  39. #==============================================================================|
  40.  
  41. ($doublex_rmvxa ||= {})[:Diagonal_Movement] = "v1.00a"
  42.  
  43. #==============================================================================|
  44. #  ** Script Implementations                                                   |
  45. #     You need not edit this part as it's about how this script works          |
  46. #------------------------------------------------------------------------------|
  47. #  * Script Support Info:                                                      |
  48. #    1. Prerequisites                                                          |
  49. #       - Basic knowledge of pixel movement                                    |
  50. #       - Some RGSS3 scripting proficiency to fully comprehend this script     |
  51. #    2. Method documentation                                                   |
  52. #       - The 1st part describes why this method's rewritten/aliased for       |
  53. #         rewritten/aliased methods or what the method does for new methods    |
  54. #       - The 2nd part describes what the arguments of the method are          |
  55. #       - The 3rd part informs which version rewritten, aliased or created this|
  56. #         method                                                               |
  57. #       - The 4th part informs whether the method's rewritten or new           |
  58. #       - The 5th part describes how this method works for new methods only,   |
  59. #         and describes the parts added, removed or rewritten for rewritten or |
  60. #         aliased methods only                                                 |
  61. #       Example:                                                               |
  62. # #--------------------------------------------------------------------------| |
  63. # #  Why rewrite/alias/What this method does                                 | |
  64. # #--------------------------------------------------------------------------| |
  65. # # *argv: What these variables are                                            |
  66. # # &argb: What this block is                                                  |
  67. # def def_name(*argv, &argb) # Version X+; Rewrite/New                         |
  68. #   # Added/Removed/Rewritten to do something/How this method works            |
  69. #   def_name_code                                                              |
  70. #   #                                                                          |
  71. # end # def_name                                                               |
  72. #------------------------------------------------------------------------------|
  73.  
  74. class Game_Player < Game_Character # Edit
  75.  
  76.   def move_by_input # Rewrite
  77.     # Rewritten
  78.     return if !movable? || $game_map.interpreter.running? || Input.dir4 == 0
  79.     return move_straight(Input.dir4) if Input.dir8 % 2 == 0
  80.     case Input.dir8
  81.     when 1
  82.       move_diagonal(4, 2)
  83.     when 3
  84.       move_diagonal(6, 2)
  85.     when 7
  86.       move_diagonal(4, 8)
  87.     when 9
  88.       move_diagonal(6, 8)
  89.     end
  90.     check_event_trigger_touch_front
  91.     #
  92.   end # move_by_input
  93.  
  94. end # Game_Player
  95.  
  96. #------------------------------------------------------------------------------|
  97.  
  98. #==============================================================================|
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement