Correr con salto y salto fuerte V1.1 by Clark-CLK
Introducción:
Este script te permite hacer que el personaje corra a una velocidad y teclas personalizadas. Tambien incuye la función de salto (Personalizable) y salto fuerte (que se ejecuta al pulsar la tecla de salto mientras se corre).
Créditos: Clark-CLK
Script:
Wong Wong!!
P.D: Acuerdense de darme créditos por el script
Introducción:
Este script te permite hacer que el personaje corra a una velocidad y teclas personalizadas. Tambien incuye la función de salto (Personalizable) y salto fuerte (que se ejecuta al pulsar la tecla de salto mientras se corre).
Créditos: Clark-CLK
Script:
Código:
#===============================================================================
#
# Script: Correr con salto V1.1
# Autor: Clark-CLK (Créditos, por favor)
# Versión: 1.1
# Fecha de creación: 12/07/12 (dd.mm.yy)
# Instrucciones: Copiar y pegar encima de main. Personalizar a gusto <img src="http://s41.ucoz.net/sm/19/smile.gif" border="0" align="absmiddle" alt="smile" />
# Mas scripts, tutos, RPG MAKER en: http://ahoperpg-maker.ucoz.es
# Agradecimientos especiales a NewOld por su ayuda con un bug.
#
#===============================================================================
=begin
Tabla de correspondencia.
Teclado #Z, Shift #Esc., 0, X #C, Space, Enter #A #S #D #Q #W #
RGSS #A #B #C #X #Y #Z #L #R #
=end
module Clark_System
# Tecla de correr. Mirar tabla de correspondencia.
Correr_Input = Input::Y
# Tecla de salto. Mirar tabla de correspondencia.
Saltar_Input = Input::C
# Velocidad al correr.
Correr_Speed = 5.4
# Velocidad al caminar normal.
Normal_Speed = 4.0
# Potencia del salto normal.
Normal_Jump = 8
# Potencia del salto fuerte
Strong_Jump = 10
end
class Game_Character
def jumpa(x_plus, y_plus, high)
if x_plus != 0 or y_plus != 0
if x_plus.abs > y_plus.abs
x_plus < 0 ? turn_left : turn_right
else
y_plus < 0 ? turn_up : turn_down
end
end
new_x = @x + x_plus
new_y = @y + y_plus
if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
straighten
@x = new_x
@y = new_y
distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round
@jump_peak = high + distance - @move_speed
@jump_count = @jump_peak * 2
@stop_count = 0
end
end
end
class Game_Player < Game_Character
alias correr_salto_update update
def update
if Input.press? (Clark_System::Correr_Input)
@move_speed = Clark_System::Correr_Speed
if Input.trigger? (Clark_System::Saltar_Input)
if @direction == 2
jump_down_strong
end
if @direction == 4
jump_left_strong
end
if @direction == 6
jump_right_strong
end
if direction == 8
jump_up_strong
end
end
elsif
@move_speed = Clark_System::Normal_Speed
if Input.trigger? (Clark_System::Saltar_Input)
if @direction == 2
jump_down
end
if @direction == 4
jump_left
end
if @direction == 6
jump_right
end
if direction == 8
jump_up
end
end
end
def jump_down
jumpa (0, 2, Clark_System::Normal_Jump)
end
def jump_left
jumpa (-2, 0, Clark_System::Normal_Jump)
end
def jump_right
jumpa (2, 0, Clark_System::Normal_Jump)
end
def jump_up
jumpa (0, -2, Clark_System::Normal_Jump)
end
def jump_down_strong
jumpa (0, 4, Clark_System::Strong_Jump)
end
def jump_left_strong
jumpa (-4, 0, Clark_System::Strong_Jump)
end
def jump_right_strong
jumpa (4, 0, Clark_System::Strong_Jump)
end
def jump_up_strong
jumpa (0, -4, Clark_System::Strong_Jump)
end
correr_salto_update
end
end
Wong Wong!!
P.D: Acuerdense de darme créditos por el script