Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ==============================================================================
- # ▼▼▼▼▼▼ TroyZ - Jump Extended ▼▼▼▼▼▼
- # ==============================================================================
- # Script by : Agung Prasetyo(TroyZ)
- # Contact me by : - Email agung.endisnear.xyz@gmail.com
- # - Forum RPGMakerID, username TroyZ
- # - Handphone 085756289121
- # Engine : VXAce
- # Level : Easy
- # Version : 1.0
- # ------------------------------------------------------------------------------
- # Change Logs :
- # 31 October 2014 : Version 1.0 released
- # ------------------------------------------------------------------------------
- # How this work :
- # This script allows you to create jumping events with map coordinates as the
- # base.
- # ------------------------------------------------------------------------------
- # How to use :
- # Place it between material and main. Use this script call inside move route
- # event :
- #
- # jump_to_pos(x_pos, y_pos)
- #
- # Means that this character/event will jump into x and y coordinates at the map.
- # For example you put this script call inside player move route at the event :
- #
- # jump_to_pos(17, 20)
- #
- # Means that the player will jump into coordinate of x = 17 and y = 20 at the
- # map.
- # ------------------------------------------------------------------------------
- # Compatibility issues :
- # None yet. If you found some, let me know, and bug fixes will come out soon.
- # ------------------------------------------------------------------------------
- # Who to credit :
- # - Allah swt. : For the chance of living that he has given to me.
- # - Nabi Muhammad saw. : As a leader and messenger and prophet of Muslim.
- # I'm proud to be your follower. :)
- # - Agung Prasetyo(TroyZ) : Thats me, of course, the ones that made this script. :P
- # ------------------------------------------------------------------------------
- # License :
- # - Free Game : Just credit those names above.
- # - Commercial Game : Same as free game's license.
- # ------------------------------------------------------------------------------
- $imported = {} if $imported.nil?
- $imported[:TroyZ_JumpExtended] = true
- # ------------------------------------------------------------------------------
- # There is nothing to config beyond this line
- # ------------------------------------------------------------------------------
- class Game_Character < Game_CharacterBase
- def jump_to_pos(x_pos, y_pos)
- if x_pos.abs > y_pos.abs
- set_direction(x_pos < @x ? 4 : 6)
- else
- set_direction(y_pos < @y ? 8 : 2)
- end
- @x = x_pos
- @y = y_pos
- distance = Math.sqrt(x_pos * x_pos + y_pos * y_pos).round
- @jump_peak = 10 + distance - @move_speed
- @jump_count = @jump_peak * 2
- @stop_count = 0
- straighten
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement