Advertisement
AngryPacman

PAC Core 1.6

Jul 29th, 2011
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 25.18 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # Pacman Advanced Creative (PAC) Engine - Core engine 1.6
  4. # 23/6/2011
  5. # Type: Core
  6. # Installation: Various. See instructions.
  7. # Level: Simple, Average, Difficult
  8. #
  9. #===============================================================================
  10. #
  11. # HELLO! Welcome to PAC Core engine 1.6. This is a collection of, count it, 4
  12. # scripts that will be dedicated toward improving and fixing the VX engine and
  13. # adding core features and helpful utilities to your game.
  14. # ---------------------------------------------------------------------------- #
  15. # Description:
  16. # This pack contains 4 functions; Movement Upgrades and Fixes, Lag Reduction,
  17. # Backup and 1-Direction. Instructions for each are found below, as are their
  18. # descriptions. Read them if you want to use this script to its fullest
  19. # potential.
  20. #
  21. #===============================================================================
  22. #
  23. # PAC MOVEMENT
  24. # Description:
  25. # There are always bound to be bugs of some kind in a program, though not as
  26. # noticeable and numerous as the ones found in VX. This script will fix several
  27. # bugs with movement commands and add new features to the currently existing
  28. # ones.
  29. #
  30. # FIXES
  31. # Jump: Event will no longer jump if its destination is outside the screen or
  32. # not passable.
  33. # Random move: Event will now find the movable direction before it moves.
  34. # Collide With Characters Check: Events with priority 'Same as Characters' will
  35. # be able to walk on 'Below Characters' priority setting.
  36. # Each of these have a boolean which you can change if you wish.
  37. # SCRIPT CALLS
  38. # Open event command 'Set Move Route', click 'Script...' and type the desired
  39. # custom command.
  40. # move_toward_pos(x, y) - Will move toward co-ordinates x and y.
  41. # move_away_from_post(x, y) - Will move away from co-ordinates x and y.
  42. # move_toward_event(x) - Will move toward the event with ID x.
  43. # move_away_from_event(x) - Will move away from event with ID x.
  44. # turn_toward_pos(x, y) - Will turn toward co-ordinates x and y.
  45. # turn_away_from_pos(x, y) - Will turn away from co-ordinates x and y.
  46. # turn_toward_event(x) - Will turn toward the event with ID x.
  47. # turn_away_from_event(x) - Will turn away from the event with ID x.
  48. #
  49. #===============================================================================
  50. #
  51. # PAC LAG REDUCTION
  52. # Description:
  53. # Got a tonne of events running on your maps? Causes a lot of lag, doesn't it?
  54. # This is a lag reduction script to make your game run not as bad-like.
  55. #
  56. # CONFIGURATION
  57. # Set UPDATE_RANGE to any value between 20 and 120. It generally sits well at
  58. # around 80. If this is too low or high, the script will give you a friendly
  59. # reminder that will make your game look really bad.
  60. #
  61. #===============================================================================
  62. #
  63. # PAC BACKUP
  64. # Description:
  65. # This script will automatically back up your data files upon startup. You are
  66. # given an option to make a window pop-up letting you know how long it took to
  67. # do so.
  68. #
  69. # CONFIGURATION
  70. # BACKUP_WHEN_TEST is a boolean to check whether or not to backup the data even
  71. # when running in test play.
  72. # BACKUP_REPORT is a boolean to check whether or not to display the report
  73. # window.
  74. # DIRNAME is the name of the directory the backup files will be saved to. If it
  75. # does not exist, then the script will make it exist. It's that boss.
  76. #
  77. #===============================================================================
  78. #
  79. # PAC 1-DIRECTION
  80. # Description:
  81. # Want to give some originality to your game? Want to confuse the player in some
  82. # freaky-deaky puzzle with some weird gimmick? Do you just want to be a titanic
  83. # tool to the players? With this script, you can activate a 1-Directional
  84. # movement system with a flick of a metaphorical switch.
  85. #
  86. # CONFIGURATION
  87. # PAC_UP, PAC_DOWN, PAC_LEFT and PAC_RIGHT are the buttons the will be pressed
  88. # to go up, down, left and right respectively. This applies to 1-Directional
  89. # and convential movement.
  90. # PAC_BACK_DASH is a boolean to check if you can dash backwards during 1-Dir
  91. # movement.
  92. # PAC_1DIR_SWITCH is the ID of the switch used to activate 1-Dir movement.
  93. # When it is off conventional movement is used.
  94. #
  95. #===============================================================================
  96. #
  97. # BEGIN EDITING
  98. #
  99. #===============================================================================
  100.  
  101. module PAC
  102.   module CORE
  103.     SAFE_JUMP = true
  104.     RANDOM_MOVE_FIX = true
  105.     COLLIDE_FIX = true
  106.     UPDATE_RANGE = 80
  107.     BACKUP_WHEN_TEST = true
  108.     BACKUP_REPORT = false
  109.     DIRNAME = 'Backup Data'
  110.     PAC_UP = Input::UP
  111.     PAC_DOWN = Input::DOWN
  112.     PAC_LEFT = Input::LEFT
  113.     PAC_RIGHT = Input::RIGHT
  114.     PAC_BACK_DASH = false
  115.     PAC_1DIR_SWITCH = 1
  116.    
  117. #===============================================================================
  118. #
  119. # DO NOT EDIT ANYTHING ELSE UNLESS YOU ARE MODERN ALGEBRA.
  120. #
  121. #===============================================================================
  122.    
  123.   end
  124. end
  125.  
  126. $imported = {} if $imported == nil
  127. $imported["PAC_Core1.6"] = true
  128.  
  129. #===============================================================================
  130. #
  131. # PAC MOVEMENT UPGRADES AND FIXES
  132. #
  133. #===============================================================================
  134.  
  135. #==============================================================================
  136. # ** Game_Character
  137. #------------------------------------------------------------------------------
  138. #  This class deals with characters. It's used as a superclass of the
  139. # Game_Player and Game_Event classes.
  140. #==============================================================================
  141.  
  142. class Game_Character
  143.   #--------------------------------------------------------------------------
  144.   # * Jump
  145.   #--------------------------------------------------------------------------
  146.   if PAC::CORE::SAFE_JUMP
  147.   def jump(x_plus, y_plus)
  148.     if x_plus.abs > y_plus.abs
  149.       x_plus < 0 ? turn_left : turn_right
  150.     elsif x_plus.abs > y_plus.abs
  151.       y_plus < 0 ? turn_up : turn_down
  152.     end
  153.     new_x = @x + x_plus
  154.     new_y = @y + y_plus
  155.     if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y)
  156.       @x += x_plus
  157.       @y += y_plus
  158.       distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round
  159.       @jump_peak = 10 + distance - @move_speed
  160.       @jump_count = @jump_peak * 2
  161.       @stop_count = 0
  162.       straighten
  163.     end
  164.   end
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # * Random move
  168.   #--------------------------------------------------------------------------
  169.   if PAC::CORE::RANDOM_MOVE_FIX
  170.   def move_random
  171.     safe = false
  172.     checked = []
  173.     while safe == false
  174.       break if checked.include?(0) and checked.include?(1) and
  175.       checked.include?(2) and checked.include?(3)
  176.       case rand(4)
  177.       when 0; return if checked.include?(0); checked.push 0
  178.         if passable?(@x, @y + 1)
  179.           safe = true; move_down(false)
  180.         end
  181.       when 1; return if checked.include?(1); checked.push 1
  182.         if passable?(@x - 1, @y)
  183.           safe = true; move_left(false)
  184.         end
  185.       when 2; return if checked.include?(2); checked.push 2
  186.         if passable?(@x + 1, @y)
  187.           safe = true; move_right(false)
  188.         end
  189.       when 3; return if checked.include?(3); checked.push 3
  190.         if passable?(@x - 1, @y)
  191.           safe = true; move_up(false)
  192.         end
  193.       end
  194.     end
  195.   end
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # * Collide with characters
  199.   #--------------------------------------------------------------------------
  200.   if PAC::CORE::COLLIDE_FIX
  201.   def collide_with_characters?(x, y)
  202.     for event in $game_map.events_xy(x, y)
  203.       unless event.through
  204.       return true if event.priority_type == 1
  205.       end
  206.     end
  207.     if @priority_type == 1
  208.       return true if $game_player.pos_nt?(x, y)
  209.       return true if $game_map.boat.pos_nt?(x, y)
  210.       return true if $game_map.ship.pos_nt?(x, y)
  211.     end
  212.     return false
  213.   end
  214.   def move_toward_pos(x,y)
  215.     sx = distance_x_from_pos(x)
  216.     sy = distance_y_from_pos(y)
  217.     if sx != 0 or sy != 0
  218.       if sx.abs > sy.abs
  219.         sx > 0 ? move_left : move_right
  220.         if @move_failed and sy != 0
  221.           sy > 0 ? move_up : move_down
  222.         end
  223.       else
  224.         sy > 0 ? move_up : move_down
  225.         if @move_failed and sx != 0
  226.           sx > 0 ? move_left : move_right
  227.         end
  228.       end
  229.     end
  230.   end
  231.   end
  232.   #--------------------------------------------------------------------------
  233.   # * Move away from Position
  234.   #--------------------------------------------------------------------------
  235.   def move_away_from_pos(x,y)
  236.     sx = distance_x_from_pos(x)
  237.     sy = distance_y_from_pos(y)
  238.     if sx != 0 or sy != 0
  239.       if sx.abs > sy.abs
  240.         sx > 0 ? move_right : move_left
  241.         if @move_failed and sy != 0
  242.           sy > 0 ? move_down : move_up
  243.         end
  244.       else
  245.         sy > 0 ? move_down : move_up
  246.         if @move_failed and sx != 0
  247.           sx > 0 ? move_right : move_left
  248.         end
  249.       end
  250.     end
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # * Move toward Event
  254.   #--------------------------------------------------------------------------
  255.   def move_toward_event(id)
  256.     move_toward_pos($game_map.events[id].x,$game_map.events[id].y)
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # * Move away from Event
  260.   #--------------------------------------------------------------------------
  261.   def move_away_from_event(id)
  262.     move_away_from_pos($game_map.events[id].x,$game_map.events[id].y)
  263.   end
  264.   #--------------------------------------------------------------------------
  265.   # * Turn toward Position
  266.   #--------------------------------------------------------------------------
  267.   def turn_toward_pos(x,y)
  268.     sx = distance_x_from_pos(x)
  269.     sy = distance_y_from_pos(y)
  270.     if sx.abs > sy.abs
  271.       sx > 0 ? turn_left : turn_right
  272.     elsif sx.abs < sy.abs
  273.       sy > 0 ? turn_up : turn_down
  274.     end
  275.   end
  276.   #--------------------------------------------------------------------------
  277.   # * Turn away from Position
  278.   #--------------------------------------------------------------------------
  279.   def turn_away_from_pos(x,y)
  280.     sx = distance_x_from_pos(x)
  281.     sy = distance_y_from_pos(y)
  282.     if sx.abs > sy.abs                  # Horizontal distance is longer
  283.       sx > 0 ? turn_right : turn_left
  284.     elsif sx.abs < sy.abs                # Vertical distance is longer
  285.       sy > 0 ? turn_down : turn_up
  286.     end
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # * Turn toward Event
  290.   #--------------------------------------------------------------------------
  291.   def turn_toward_event(id)
  292.     turn_toward_pos($game_map.events[id].x,$game_map.events[id].y)
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # * Turn away from Event
  296.   #--------------------------------------------------------------------------
  297.   def turn_away_from_event(id)
  298.     turn_away_from_pos($game_map.events[id].x,$game_map.events[id].y)
  299.   end
  300.   #--------------------------------------------------------------------------
  301.   # * Calculate X Distance From Event
  302.   #--------------------------------------------------------------------------
  303.   def distance_x_from_pos(x)
  304.     sx = @x - x
  305.     if $game_map.loop_horizontal?
  306.       if sx.abs > $game_map.width / 2
  307.         sx -= $game_map.width
  308.       end
  309.     end
  310.     return sx
  311.   end
  312.   #--------------------------------------------------------------------------
  313.   # * Calculate Y Distance From Event
  314.   #--------------------------------------------------------------------------
  315.   def distance_y_from_pos(y)
  316.     sy = @y - y
  317.     if $game_map.loop_vertical?
  318.       if sy.abs > $game_map.height / 2
  319.         sy -= $game_map.height
  320.       end
  321.     end
  322.     return sy
  323.   end
  324. end
  325.  
  326. #===============================================================================
  327. #
  328. # PAC LAG REDUCTION
  329. #
  330. #===============================================================================
  331.  
  332. PAC::CORE::UPDATE_RANGE = PAC::CORE::UPDATE_RANGE
  333.  
  334. module Graphics
  335.   unless method_defined?(:resize_screen_pac_lag)
  336.     class << Graphics
  337.       alias resize_screen_pac_lag resize_screen
  338.     end
  339.     def self.resize_screen(width, height)
  340.       resize_screen_pac_lag(width, height)
  341.       if $game_temp != nil
  342.         $game_temp.setup_lightening_value
  343.       end
  344.     end
  345.   end
  346. end
  347.  
  348. #==============================================================================
  349. # ** Game_Temp
  350. #------------------------------------------------------------------------------
  351. #  This class handles temporary data that is not included with save data.
  352. # The instance of this class is referenced by $game_temp.
  353. #==============================================================================
  354.  
  355. class Game_Temp
  356.   attr_accessor :valid_common_event_check
  357.   attr_reader   :display_center_x
  358.   attr_reader   :display_center_y
  359.   attr_reader   :map_sprite_update_width
  360.   attr_reader   :map_sprite_update_height
  361.   #--------------------------------------------------------------------------
  362.   # alias listing
  363.   #--------------------------------------------------------------------------  
  364.   alias initialize_pac_lag initialize
  365.   #--------------------------------------------------------------------------
  366.   # * Object Initialization
  367.   #--------------------------------------------------------------------------
  368.   def initialize
  369.     initialize_pac_lag
  370.     @valid_common_event_check = true
  371.     setup_lightening_value
  372.   end
  373.   #--------------------------------------------------------------------------
  374.   # * Setup Lightening Value
  375.   #--------------------------------------------------------------------------
  376.   def setup_lightening_value
  377.     @display_center_x = Graphics.width / 2
  378.     @display_center_y = Graphics.height / 2
  379.     @map_sprite_update_width = Graphics.width * PAC::CORE::UPDATE_RANGE / 100
  380.     @map_sprite_update_height = Graphics.height * PAC::CORE::UPDATE_RANGE / 100
  381.   end
  382. end
  383.  
  384. if PAC::CORE::UPDATE_RANGE < 20
  385.   p "Your lag reduction is incredibly low. Raise it."
  386. elsif PAC::CORE::UPDATE_RANGE < 50
  387.   p "Your lag reduction isn't very high. Consider raising it."
  388. elsif PAC::CORE::UPDATE_RANGE > 120
  389.   p "Your lag reduction is quite high. Consider lowering it."
  390. end
  391.  
  392. #==============================================================================
  393. # ** Game_Switches
  394. #------------------------------------------------------------------------------
  395. #  This class handles switches. It's a wrapper for the built-in class "Array."
  396. # The instance of this class is referenced by $game_switches.
  397. #==============================================================================
  398.  
  399. class Game_Switches
  400.   #--------------------------------------------------------------------------
  401.   # alias listing
  402.   #--------------------------------------------------------------------------
  403.   alias indexer_equal_pac_lag []=
  404.   #--------------------------------------------------------------------------
  405.   # * Set Switch
  406.   #--------------------------------------------------------------------------
  407.   def []=(switch_id, value)
  408.     indexer_equal_pac_lag(switch_id, value)
  409.  
  410.     $game_temp.valid_common_event_check = true
  411.   end
  412. end
  413.  
  414. #==============================================================================
  415. # ** Game_Map
  416. #------------------------------------------------------------------------------
  417. #  This class handles maps. It includes scrolling and passage determination
  418. # functions. The instance of this class is referenced by $game_map.
  419. #==============================================================================
  420.  
  421. class Game_Map
  422.   #--------------------------------------------------------------------------
  423.   # alias listing
  424.   #--------------------------------------------------------------------------
  425.   alias setup_pac_lag setup
  426.   #--------------------------------------------------------------------------
  427.   # * Setup
  428.   #--------------------------------------------------------------------------
  429.   def setup(map_id)
  430.     setup_pac_lag(map_id)
  431.     update_valid_common_event_list
  432.   end
  433.   #--------------------------------------------------------------------------
  434.   # * Update Valid Common Event List
  435.   #--------------------------------------------------------------------------
  436.   def update_valid_common_event_list
  437.     @valid_common_events = {}
  438.     @common_events.each { |event_id, event|
  439.       if event.trigger == 2 && $game_switches[event.switch_id]
  440.         @valid_common_events[event_id] = event
  441.       end
  442.     }
  443.     $game_temp.valid_common_event_check = false
  444.   end
  445.   #--------------------------------------------------------------------------
  446.   # * Update Events
  447.   #--------------------------------------------------------------------------
  448.   def update_events
  449.     for event in @events.values
  450.       event.update
  451.     end
  452.     if $game_temp.valid_common_event_check
  453.       update_valid_common_event_list
  454.     end
  455.     for common_event in @valid_common_events.values
  456.       common_event.update
  457.     end
  458.   end
  459. end
  460.  
  461. #==============================================================================
  462. # ** Game_Interpreter
  463. #------------------------------------------------------------------------------
  464. #  An interpreter for executing event commands. This class is used within the
  465. # Game_Map, Game_Troop, and Game_Event classes.
  466. #==============================================================================
  467.  
  468. class Game_Interpreter
  469.   @@_auto_start_common_event_list = nil
  470.   #--------------------------------------------------------------------------
  471.   # alias listing
  472.   #--------------------------------------------------------------------------
  473.   alias clear_pac_lag clear
  474.   #--------------------------------------------------------------------------
  475.   # * Clear
  476.   #--------------------------------------------------------------------------
  477.   def clear
  478.     clear_pac_lag
  479.     if @@_auto_start_common_event_list == nil
  480.       create_auto_start_common_event_list
  481.     end
  482.   end
  483.   #--------------------------------------------------------------------------
  484.   # * Create Auto Start Common Event List
  485.   #--------------------------------------------------------------------------
  486.  
  487.   def create_auto_start_common_event_list
  488.     @@_auto_start_common_event_list = []
  489.     $data_common_events.compact.each { |event|
  490.       @@_auto_start_common_event_list << event if event.trigger == 1
  491.     }
  492.   end
  493.   #--------------------------------------------------------------------------
  494.   # * Setup Starting Event
  495.   #--------------------------------------------------------------------------
  496.   def setup_starting_event
  497.     if $game_map.need_refresh
  498.       $game_map.refresh
  499.     end
  500.     if $game_temp.common_event_id > 0
  501.       list = $data_common_events[$game_temp.common_event_id].list
  502.       setup(list)
  503.       $game_temp.common_event_id = 0
  504.       return
  505.     end
  506.     for event in $game_map.events.values
  507.       if event.starting
  508.         event.clear_starting
  509.         setup(event.list, event.id)
  510.         return
  511.       end
  512.     end
  513.     for event in @@_auto_start_common_event_list
  514.       if $game_switches[event.switch_id]
  515.         setup(event.list)
  516.       end
  517.     end
  518.   end
  519. end
  520.  
  521. #==============================================================================
  522. # ** Sprite_Character
  523. #------------------------------------------------------------------------------
  524. #  This sprite is used to display characters. It observes a instance of the
  525. # Game_Character class and automatically changes sprite conditions.
  526. #==============================================================================
  527.  
  528. class Sprite_Character < Sprite_Base
  529.   #--------------------------------------------------------------------------
  530.   # * Within Update Range
  531.   #--------------------------------------------------------------------------
  532.   def within_update_range?
  533.     sx = @character.screen_x - $game_temp.display_center_x
  534.     sy = @character.screen_y - $game_temp.display_center_y
  535.     return (sx.abs <= $game_temp.map_sprite_update_width &&
  536.       sy.abs <= $game_temp.map_sprite_update_height)
  537.   end
  538. end
  539.  
  540. #==============================================================================
  541. # ** Spriteset_Map
  542. #------------------------------------------------------------------------------
  543. #  This class brings together map screen sprites, tilemaps, etc. It's used
  544. # within the Scene_Map class.
  545. #==============================================================================
  546.  
  547. class Spriteset_Map
  548.   #--------------------------------------------------------------------------
  549.   # * Update Characters
  550.   #--------------------------------------------------------------------------
  551.   def update_characters
  552.     for sprite in @character_sprites
  553.       sprite.update if sprite.within_update_range?
  554.     end
  555.   end
  556. end
  557.  
  558. #==============================================================================
  559. # ** Scene_Map
  560. #------------------------------------------------------------------------------
  561. #  This class performs the map screen processing.
  562. #==============================================================================
  563.  
  564. class Scene_Map < Scene_Base
  565.  
  566.   #--------------------------------------------------------------------------
  567.   # * Frame Update
  568.   #--------------------------------------------------------------------------
  569.   def update
  570.     super
  571.     $game_map.interpreter.update
  572.     $game_map.update
  573.     $game_player.update
  574.     $game_system.update
  575.     @spriteset.update
  576.     @message_window.update
  577.     unless $game_message.visible
  578.       update_transfer_player
  579.       update_encounter
  580.       update_call_menu
  581.       update_call_debug
  582.       if $game_temp.next_scene != nil
  583.         update_scene_change
  584.       end
  585.     end
  586.   end
  587. end
  588.  
  589. #===============================================================================
  590. #
  591. # PAC BACKUP
  592. #
  593. #===============================================================================
  594.  
  595. module PAC
  596.   module CORE
  597.    
  598. SCRIPT = <<_SCRIPT_
  599.     if (BACKUP_WHEN_TEST && #{defined?(Graphics.wait) ? '$TEST' : '$DEBUG'}) ||
  600.     !BACKUP_WHEN_TEST
  601.       time = Time.now
  602.       Dir.mkdir(DIRNAME) unless File.directory?(DIRNAME)
  603.       ftype = "#{defined?(Graphics.wait) ? 'rvdata' : 'rxdata'}"
  604.       flist = Dir.glob('./Data/*.{' + ftype + '}')
  605.       flist.each_index do |i|
  606.         flist[i] = flist[i].split('/').last
  607.         save_data(load_data('Data/' + flist[i]), DIRNAME + '/' + flist[i])
  608.       end
  609.       if BACKUP_REPORT
  610.         p('The PAC says: Backup Complete - ' + (Time.now - time).to_s + ' sec')
  611.       end
  612.     end
  613. _SCRIPT_
  614.  
  615. eval(SCRIPT) unless $@
  616.   end
  617. end
  618.  
  619. if PAC::CORE::BACKUP_WHEN_TEST != true || false
  620.   p "The PAC says: Backup when test constant set to invalid value."
  621.   p "Check your core script."
  622. end
  623.  
  624. #===============================================================================
  625. #
  626. # PAC 1-DIRECTION
  627. #
  628. #===============================================================================
  629.  
  630. if PAC::CORE::PAC_BACK_DASH != true and PAC::CORE::PAC_BACK_DASH != false
  631.   p "The PAC says: Back dash constant set to invalid value."
  632.   p "Check your Core script."
  633. end
  634.  
  635. #==============================================================================
  636. # ** Game_Player
  637. #------------------------------------------------------------------------------
  638. #  This class handles maps. It includes event starting determinants and map
  639. # scrolling functions. The instance of this class is referenced by $game_map.
  640. #==============================================================================
  641.  
  642. class Game_Player < Game_Character
  643.   #--------------------------------------------------------------------------
  644.   # alias listing
  645.   #--------------------------------------------------------------------------
  646.   alias pac_1dir_backdash dash?
  647.   #--------------------------------------------------------------------------
  648.   # * Move by Input
  649.   #--------------------------------------------------------------------------
  650.   def move_by_input
  651.     return unless movable?
  652.     return if $game_map.interpreter.running?
  653.     if $game_switches[PAC::CORE::PAC_1DIR_SWITCH]
  654.       if Input.press?(PAC::CORE::PAC_UP)
  655.         move_forward
  656.       elsif Input.repeat?(PAC::CORE::PAC_LEFT)
  657.         turn_left_90
  658.       elsif Input.repeat?(PAC::CORE::PAC_RIGHT)
  659.         turn_right_90
  660.       elsif Input.press?(PAC::CORE::PAC_DOWN)
  661.         move_backward
  662.       end
  663.     else
  664.       if Input.press?(PAC::CORE::PAC_UP)
  665.         move_up
  666.       elsif Input.press?(PAC::CORE::PAC_LEFT)
  667.         move_left
  668.       elsif Input.press?(PAC::CORE::PAC_RIGHT)
  669.         move_right
  670.       elsif Input.press?(PAC::CORE::PAC_DOWN)
  671.         move_down
  672.       end
  673.     end
  674.   end
  675.   #--------------------------------------------------------------------------
  676.   # * Dash?
  677.   #--------------------------------------------------------------------------
  678.   def dash?
  679.     return false if $game_switches[PAC::CORE::PAC_1DIR_SWITCH] and
  680.     Input.press?(PAC::CORE::PAC_DOWN) and !PAC::CORE::PAC_BACK_DASH
  681.     pac_1dir_backdash # The usual.
  682.   end
  683. end
  684.  
  685. #===============================================================================
  686. #
  687. # END OF SCRIPT
  688. #
  689. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement