TheoAllen

Theo - Simple Diagonal Movement

Jun 27th, 2013
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.90 KB | None | 0 0
  1. # =============================================================================
  2. # TheoAllen - Simple Diagonal Movement
  3. # Version : 1.0
  4. # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
  5. # (English Documentation)
  6. # =============================================================================
  7. ($imported ||= {})[:Theo_DiagonalMove] = true
  8. # =============================================================================
  9. # CHANGE LOGS:
  10. # -----------------------------------------------------------------------------
  11. # 2013.06.28 - Finished snippet
  12. # =============================================================================
  13. =begin
  14.  
  15.   Introduction :
  16.   This script allow you to move the actor in diagonal direction.
  17.  
  18.   How to use :
  19.   Just simply put this script below material but above.
  20.   If you use Theo - Force Stop Movements, place this script above it.
  21.  
  22.   Terms of use :
  23.   This just a simple script. You're free to edit by your own or even use in
  24.   commercial purposes. Credit isn't neccessary. But I would be thankful if
  25.   you put my name in credit list.
  26.  
  27. =end
  28. # =============================================================================
  29. # No custom configuration.
  30. # =============================================================================
  31. class Game_Player < Game_Character
  32.  
  33.   # -------------------------------------------------------------------------
  34.   # Overwrite move by input
  35.   # -------------------------------------------------------------------------
  36.   def move_by_input
  37.     return if !movable? || $game_map.interpreter.running?
  38.     case Input.dir8
  39.     when 1
  40.       move_diagonal(4,2)
  41.     when 2
  42.       move_straight(2)
  43.     when 3
  44.       move_diagonal(6,2)
  45.     when 4
  46.       move_straight(4)
  47.     when 6
  48.       move_straight(6)
  49.     when 7
  50.       move_diagonal(4,8)
  51.     when 8
  52.       move_straight(8)
  53.     when 9
  54.       move_diagonal(6,8)
  55.     end
  56.   end
  57.  
  58. end
Advertisement
Add Comment
Please, Sign In to add comment