09-23-2009, 11:41 PM
(This post was last modified: 09-02-2024, 05:53 PM by DerVVulfman.)
AWorks Fix Walk Speed
Created by: AWorks(vgvgf)
Version: 1.00
Updated: 18/06/2009(dd/mm/yyyy)
This is one of my shortest and simplest scripts. Useful though.
Description
This script modifies the movement speed of events and the player when they walk in a diagonal direction. Normaly when a event walk in a diagonal, it will move faster than it should.
Created by: AWorks(vgvgf)
Version: 1.00
Updated: 18/06/2009(dd/mm/yyyy)
This is one of my shortest and simplest scripts. Useful though.
Description
This script modifies the movement speed of events and the player when they walk in a diagonal direction. Normaly when a event walk in a diagonal, it will move faster than it should.
Code:
#=============================================================================
# *** AWorks Fix Walk Speed VX
#=============================================================================
# Created by AWorks
# Version: 1.00.VX
# Updated: 18/06/2009 (dd/mm/yyyy)
#=============================================================================
#==== Description ====
# This script modifies the movement speed of events and the player when they
# walk in a diagonal direction.
#=============================================================================
#==============================================================================
# ** Game_Character
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Update While Moving
#--------------------------------------------------------------------------
def update_move
if @x * 256 != @real_x and @y * 256 != @real_y
distance = 2 ** @move_speed / Math.sqrt(2)
else
distance = 2 ** @move_speed
end
distance *= 2 if dash?
@real_x = [@real_x - distance, @x * 256].max if @x * 256 < @real_x
@real_x = [@real_x + distance, @x * 256].min if @x * 256 > @real_x
@real_y = [@real_y - distance, @y * 256].max if @y * 256 < @real_y
@real_y = [@real_y + distance, @y * 256].min if @y * 256 > @real_y
update_bush_depth unless moving?
if @walk_anime
@anime_count += 1.5
elsif @step_anime
@anime_count += 1
end
end
end