Sign in to follow this  
Followers 0
Fegarur

Saltar

2 posts in this topic

Descripción:
Este pequeño script hace que el personaje pueda saltar en el mapa siempre y cuando un interruptor (por defecto, el primero) esté activo. La tecla para saltar es personalizable, pero por defecto es la A (X).
No veo utilidad para una screen y creo que una demo no es necesaria.

Script:
[SPOILER]
CODE
#===================================
# Sistema de Salto DRodrigues
#===================================
#--------------------------------------------------------------
# Tecla de Salto, cambia la "X" por la tecla que quieras.
Jump_Button = Input::X
# Número del interruptor que activa y desactiva la posibilidad de saltar.
Switche_Active = 1
#--------------------------------------------------------------

class Jump_System < Game_Character
def initialize
update
end
def update
if $game_switches[Switche_Active] == true
if Input.trigger?(Jump_Button)
case $game_player.direction
when 2
jump_y = 1
jump_x = 0
when 4
jump_x = -1
jump_y = 0
when 6
jump_x = 1
jump_y = 0
when 8
jump_y = -1
jump_x = 0
end
$game_player.jump(jump_x,jump_y)
end
end
end
end
class Scene_Map
alias jump_update update
alias jump_main main
def main
@jumping = Jump_System.new
jump_main
end
def update
@jumping.update
jump_update
end
end
[/SPOILER]

Créditos:
Script creado por DRodrigues.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0