Tem sistema de pulo ????????/
tipo mario , to precisado !!!!!!!!!!!
+1 cred
#===============================================================================
# ** Pulo com Impulso
#-------------------------------------------------------------------------------
# @version 1.1
# @author DeathDragon
#-------------------------------------------------------------------------------
# @brief Script para pular de acordo com o impulso do personagem
#===============================================================================
class Game_Player
#-----------------------------------------------------------------------------
# * Alias
#-----------------------------------------------------------------------------
unless ($@)
alias :puloComImpulso_1 :initialize
alias :puloComImpulso_2 :update
end
#-----------------------------------------------------------------------------
# * Construtor
#-----------------------------------------------------------------------------
def initialize
puloComImpulso_1
@jx, @jy = 0, 0
end
#-----------------------------------------------------------------------------
# * Atualização
#-----------------------------------------------------------------------------
def update
puloComImpulso_2
if (moving?)
@jx += 1
@jy -= 1
if (@jx > 8)
@jx = 8
end
if (@jy < -8)
@jy = -8
end
else
@jx, @jy = 0, 0
end
if ((not jumping?) and (Input.trigger?(Input::C)))
case (@direction)
when 2
jump(0, @jx) if $game_map.valid?(@x, @y + @jx)
when 4
jump(@jy, 0) if $game_map.valid?(@x + @jy, @y)
when 6
jump(@jx, 0) if $game_map.valid?(@x + @jx, @y)
when 8
jump(0, @jy) if $game_map.valid?(@x, @y + @jy)
end
end
end
end
Euri kkkkkkkk mas o vinks ta certo mesmo GustavotxCaso tenha preguiça de abrir o tópico e pegar o script, aqui está ele:
begin
================================================================================
Amethyst Platform System - Versão 1.2 RMVX - 25/03/2010
================================================================================
--------------------------------------------------------------------------------
Creditos\Condições de uso
--------------------------------------------------------------------------------
Criado por Khas.
Todos os scripts Amethyst estão licenciados sobre Creative Commons
Todos os scripts Amethyst só podem ser usados em projetos não-comerciais,
caso use em projeto comercial envie uma PM com o pedido.
--------------------------------------------------------------------------------
Caracteristicas
--------------------------------------------------------------------------------
O Amethyst Platform System transforma os mapas selecionados na constante
Amp_System_Maps (veja a parte de configuração) em mapas estilo plataforma.
--------------------------------------------------------------------------------
Instruções - Instalação
--------------------------------------------------------------------------------
1 - Cole este script acima de todos os seus scripts adicionais
2 - Configure-o na parte de configuração
--------------------------------------------------------------------------------
Instruções - Criando mapas
--------------------------------------------------------------------------------
Os tiles não passaveis serão a plataforma e os tiles passaveis são aonde
o personagem pode cair\pular. Os eventos de mapa também sofrem ação da
gravidade do sistema, ou seja, podem cair em buracos também
--------------------------------------------------------------------------------
Importante
--------------------------------------------------------------------------------
Por algum motivo este script não reconhece os tiles não passaveis do TileA
Então todo o mapeamento deve ser feito com os Tilesets restantes
--------------------------------------------------------------------------------
Configuração
--------------------------------------------------------------------------------
=end
module Amp_Config
# Mapas estilo plataforma, coloque o ID dentro do [], separados por virgulas
Amp_System_Maps = [1,3,4]
# Força da gravidade, varia de 0~2
GForce = 1
# Tecla para pular
Jump_Key = Input::X
# Força do pulo, valores de 0~5
Jump_Force = 1
# Som reproduzido ao pular
Jump_Sound = "Jump1"
end
#-------------------------------------------------------------------------------
# Não altere nada abaixo, a menos que saiba o que está fazendo!
#-------------------------------------------------------------------------------
$Amethyst_Scripts = {} if $Amethyst_Scripts.nil?
$Amethyst_Scripts["Am Platform System"] = ["1.2","25/03/2010"]
class Game_Character
alias amp_original_initialize initialize
alias amp_original_update update
alias amp_original_move_up move_up
alias amp_original_move_down move_down
alias amp_original_move_left move_left
alias amp_original_move_right move_right
alias amp_original_move_random move_random
alias amp_original_turn_random turn_random
alias amp_original_move_toward_player move_toward_player
alias amp_original_move_away_from_player move_away_from_player
def amp_map?
$game_map.nil? ? i = false : i = Amp_Config::Amp_System_Maps.include?($game_map.map_id)
return i
end
def initialize
if amp_map?
@gforce = false; @nforce = false; @sforce = nil
end
amp_original_initialize
end
def update
amp_original_update
return unless amp_map?
force_gravity if @gforce
stop_gravity_force if @nforce
end
def force_gravity
return if moving?
@move_speed = Amp_Config::GForce+4
@y = $game_map.round_y(@y+1)
@real_y = (@y-1)*256
if passable?(@x, @y+1); @gforce = true
else; @nforce = true; @gforce = false
end
end
def check_gravity_force
if passable?(@x, @y+1)
@sforce = @move_speed
@gforce = true
@walk_anime = false
else
check_event_trigger_touch(@x, @y+1)
end
end
def stop_gravity_force
return if moving?
@nforce = false
@gforce = false
@walk_anime = true
@move_speed = @sforce
@sforce = nil
end
def move_up(turn_ok = true)
amp_map? ? amp_move_up(turn_ok) : amp_original_move_up(turn_ok)
end
def move_down(turn_ok = true)
amp_map? ? amp_move_down(turn_ok) : amp_original_move_down(turn_ok)
end
def move_left(turn_ok = true)
amp_map? ? amp_move_left(turn_ok) : amp_original_move_left(turn_ok)
end
def move_right(turn_ok = true)
amp_map? ? amp_move_right(turn_ok) : amp_original_move_right(turn_ok)
end
def move_random
amp_map? ? amp_move_random : amp_original_move_random
end
def move_toward_player
amp_map? ? amp_move_toward_player : amp_original_move_toward_player
end
def move_away_from_player
amp_map? ? amp_move_away_from_player : amp_original_move_away_from_player
end
def turn_random
amp_map? ? amp_turn_random : amp_original_turn_random
end
def amp_move_up(turn_ok)
if passable?(@x, @y-1)
@y = $game_map.round_y(@y-1)
@real_y = (@y+1)*256
increase_steps
@move_failed = false
else
check_event_trigger_touch(@x, @y-1)
@move_failed = true
end
end
def amp_move_down(turn_ok)
if passable?(@x, @y+1)
@y = $game_map.round_y(@y+1)
@real_y = (@y-1)*256
increase_steps
@move_failed = false
else
check_event_trigger_touch(@x, @y+1)
@move_failed = true
end
end
def amp_move_left(turn_ok)
if passable?(@x-1, @y)
turn_left if turn_ok
@x = $game_map.round_x(@x-1)
@real_x = (@x+1)*256
increase_steps
check_gravity_force
@move_failed = false
else
turn_left if turn_ok
check_event_trigger_touch(@x-1, @y)
@move_failed = true
end
end
def amp_move_right(turn_ok)
if passable?(@x+1, @y)
turn_right if turn_ok
@x = $game_map.round_x(@x+1)
@real_x = (@x-1)*256
increase_steps
check_gravity_force
@move_failed = false
else
turn_right if turn_ok
check_event_trigger_touch(@x+1, @y)
@move_failed = true
end
end
def amp_move_random
case rand(2)
when 0; move_left(false)
when 1; move_right(false)
end
end
def amp_move_toward_player
sx = distance_x_from_player
return if sx == 0
sx > 0 ? move_right : move_left
end
def amp_move_away_from_player
sx = distance_x_from_player
return if sx == 0
sx > 0 ? move_right : move_left
end
def amp_turn_random
case rand(2)
when 0; turn_right
when 1; turn_left
end
end
end
class Game_Player < Game_Character
alias amp_2original_initialize initialize
alias amp_2original_update update
alias amp_2original_move_by_input move_by_input
def initialize
amp_2original_initialize
@jforce = 0
end
def update
amp_2original_update
update_jump_force if amp_map? and [email=!@gforce]!@gforce[/email]
end
def update_jump_force
if @jforce > 0
return if moving?
if @jforce > 1
if Input.press?(Input::RIGHT)
turn_right
jump_upper_right
elsif Input.press?(Input::LEFT)
turn_left
jump_upper_left
else
jump_up
end
else
@move_speed = 4
@walk_anime = true
check_gravity_force
end
@jforce -= 1
else
if Input.trigger?(Amp_Config::Jump_Key)
RPG::SE.new(Amp_Config::Jump_Sound,80).play
dash? ? @jforce = 4+Amp_Config::Jump_Force : @jforce = 3+Amp_Config::Jump_Force
@move_speed = 5
@walk_anime = false
@pattern = 0
end
end
end
def force_gravity
return if moving?
@move_speed = Amp_Config::GForce+4
if Input.press?(Input::RIGHT)
turn_right
gforce_lower_right
elsif Input.press?(Input::LEFT)
turn_left
gforce_lower_left
else
@y = $game_map.round_y(@y+1)
@real_y = (@y-1)*256
end
check_touch_event
if passable?(@x, @y+1); @gforce = true
else; @nforce = true; @gforce = false
end
end
def gforce_lower_left
if (passable?(@x, @y+1) and passable?(@x-1, @y+1)) or
(passable?(@x-1, @y) and passable?(@x-1, @y+1))
@x -= 1
@y += 1
else
@y = $game_map.round_y(@y+1)
@real_y = (@y-1)*256
end
end
def gforce_lower_right
if (passable?(@x, @y+1) and passable?(@x+1, @y+1)) or
(passable?(@x+1, @y) and passable?(@x+1, @y+1))
@x += 1
@y += 1
else
@y = $game_map.round_y(@y+1)
@real_y = (@y-1)*256
end
end
def jump_up
if passable?(@x, @y-1)
@y = $game_map.round_y(@y-1)
@real_y = (@y+1)*256
@move_failed = false
else
check_event_trigger_touch(@x, @y-1)
@move_failed = true
@jforce = 0
check_gravity_force
end
end
def jump_upper_left
unless @direction_fix
@direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
end
if (passable?(@x, @y-1) and passable?(@x-1, @y-1)) or
(passable?(@x-1, @y) and passable?(@x-1, @y-1))
@x -= 1
@y -= 1
else
jump_up
end
end
def jump_upper_right
unless @direction_fix
@direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
end
if (passable?(@x, @y-1) and passable?(@x+1, @y-1)) or
(passable?(@x+1, @y) and passable?(@x+1, @y-1))
@x += 1
@y -= 1
else
jump_up
end
end
def move_by_input
amp_map? ? amp_move_by_input : amp_2original_move_by_input
end
def amp_move_by_input
return if @gforce
return unless movable?
return if $game_map.interpreter.running?
case Input.dir4
when 4; move_left
when 6; move_right
end
end
end
#===============================================================
# ● [VX] ◦ Smooth Scrolling ◦ □
# * Nice scrolling effect like an action game~! *
# * Ported from XP Version (by Toby Zerner) *
#--------------------------------------------------------------
# ◦ by Woratana [woratana@hotmail.com]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 08/02/2009
# ◦ Version: 1.0
#--------------------------------------------------------------
# ◦ Compatibility:
#--------------------------------------------------------------
# □ This script will rewrite 6 method(s):
# Game_Map.start_scroll
# Game_Map.scroll_up
# Game_Map.scroll_down
# Game_Map.scroll_left
# Game_Map.scroll_right
# Game_Map.update_scroll
#
# □ This script will alias 1 method(s):
# Game_Map.setup_scroll
#
# □ This script would crash with other custom scripts that rewrite same method(s)
#
# □ This script may not work with maps that use loop.
#--------------------------------------------------------------
# ◦ Installation:
#--------------------------------------------------------------
# 1) This script should be placed JUST AFTER ▼ Materials.
#
# □ Like this:
# ▼ Materials
# * Smooth Scrolling
# ...
# ...
# ▼ Main Process
# Main
#
# 2) Setup this script in Setup Part below.
#
#--------------------------------------------------------------
# ◦ How to use:
#--------------------------------------------------------------
# □ Just place this script and try moving player in your game.
#
#=================================================================
class Game_System
#=================================================================
# ++ Setup Part
#-----------------------------------------------------------------
DEFAULT_DECELERATION_START = 10 # (default: 4)
# How fast before it will start decelerating (Higher = Start Faster)
# You can change this value in game by call script:
# $game_system.decel_start = (value)
DEFAULT_DECELERATION_SPEED = 10 # (default: 4)
# How fast it will decelerate each frame (Higher = Decelerate Faster)
# You can change this value in game by call script:
# $game_system.decel_speed = (value)
#-----------------------------------------------------------------
def decel_start
@decel_start ||= DEFAULT_DECELERATION_START
return @decel_start
end
def decel_speed
@decel_speed ||= DEFAULT_DECELERATION_SPEED
return @decel_speed
end
def decel_start=(value)
@decel_start = value
end
def decel_speed=(value)
@decel_speed = value
end
end
class Game_Map
#--------------------------------------------------------------------------
# * Scroll Setup
#--------------------------------------------------------------------------
alias wora_smoscr_gammap_setscr setup_scroll
def setup_scroll(*args)
wora_smoscr_gammap_setscr(*args)
# Initialize smooth scrolling variables
# scroll_remain: the number of pixels * 4 the still need to be scrolled
@scroll_remain_x = 0
@scroll_remain_y = 0
# scroll_take: the number of pixels * 4 that are being scrolled every frame
# i.e. scrolling speed
@scroll_take_x = 0
@scroll_take_y = 0
# scroll_decel: variables for calculating decelaration
@scroll_decel_x = 0
@scroll_decel_y = 0
end
#--------------------------------------------------------------------------
# * Start Scroll
#--------------------------------------------------------------------------
def start_scroll(direction, distance, speed)
# Set scrolling variables
distance = distance.ceil * 256
@scroll_direction = direction
@scroll_speed = speed
@scroll_rest = distance
# Execute scrolling
case @scroll_direction
when 2 # Down
scroll_down(@scroll_rest)
when 4 # Left
scroll_left(@scroll_rest)
when 6 # Right
scroll_right(@scroll_rest)
when 8 # Up
scroll_up(@scroll_rest)
end
end
#--------------------------------------------------------------------------
# * Scroll Down
#--------------------------------------------------------------------------
def scroll_down(distance)
# Ceil the distance
distance = distance.ceil
# If the map is scrolling from an event command, then use that scroll speed
if scrolling? then @scroll_take_y = 2 ** @scroll_speed
# If the map is not scrolling
else
# Make sure the distance is always divisible by 4
if distance.ceil % 4 == 0 then @scroll_take_y = distance.ceil
elsif distance.ceil % 4 <= 2 then @scroll_take_y = distance.ceil - distance.ceil % 4
else @scroll_take_y = distance.ceil + (4 - (distance.ceil % 4)) end
end
# If scrolling coordinates are inside the map's boundaries
unless @display_y + @scroll_remain_y + distance > (self.height - 13) * 256
# Add onto the amount left to be scrolled
@scroll_remain_y += distance
end
end
#--------------------------------------------------------------------------
# * Scroll Left
#--------------------------------------------------------------------------
def scroll_left(distance)
# Ceil the distance
distance = distance.ceil
# If the map is scrolling from an event command, then use that scroll speed
if scrolling? then @scroll_take_x = 2 ** @scroll_speed
# If the map is not scrolling
else
# Make sure the distance is always divisible by 4
if distance.ceil % 4 == 0 then @scroll_take_x = distance.ceil
elsif distance.ceil % 4 <= 2 then @scroll_take_x = distance.ceil - distance.ceil % 4
else @scroll_take_x = distance.ceil + (4 - (distance.ceil % 4)) end
end
# If scrolling coordinates are inside the map's boundaries
unless @display_x - @scroll_remain_x - distance < 0
# Add onto the amount left to be scrolled
@scroll_remain_x -= distance
end
end
#--------------------------------------------------------------------------
# * Scroll Right
#--------------------------------------------------------------------------
def scroll_right(distance)
# Ceil the distance
distance = distance.ceil
# If the map is scrolling from an event command, then use that scroll speed
if scrolling? then @scroll_take_x = 2 ** @scroll_speed
# If the map is not scrolling
else
# Make sure the distance is always divisible by 4
if distance.ceil % 4 == 0 then @scroll_take_x = distance.ceil
elsif distance.ceil % 4 <= 2 then @scroll_take_x = distance.ceil - distance.ceil % 4
else @scroll_take_x = distance.ceil + (4 - (distance.ceil % 4)) end
end
# If scrolling coordinates are inside the map's boundaries
unless @display_x + @scroll_remain_x + distance > (self.width - 17) * 256
# Add onto the amount left to be scrolled
@scroll_remain_x += distance
end
end
#--------------------------------------------------------------------------
# * Scroll Up
#--------------------------------------------------------------------------
def scroll_up(distance)
# Ceil the distance
distance = distance.ceil
# If the map is scrolling from an event command, then use that scroll speed
if scrolling? then @scroll_take_y = 2 ** @scroll_speed
# If the map is not scrolling
else
# Make sure the distance is always divisible by 4
if distance.ceil % 4 == 0 then @scroll_take_y = distance.ceil
elsif distance.ceil % 4 <= 2 then @scroll_take_y = distance.ceil - distance.ceil % 4
else @scroll_take_y = distance.ceil + (4 - (distance.ceil % 4)) end
end
# If scrolling coordinates are inside the map's boundaries
unless @display_y - @scroll_remain_y - distance < 0
# Add onto the amount left to be scrolled
@scroll_remain_y -= distance
end
end
#--------------------------------------------------------------------------
# * Update Scroll
#--------------------------------------------------------------------------
def update_scroll
# If the map is still scrolling
if @scroll_rest > 0 then @scroll_rest -= 2 ** @scroll_speed end
# If the x axis needs to be scrolled to the right
if @scroll_remain_x > 0
# If the amount to be scrolled is close enough to 0 to decelerate
if @scroll_remain_x <= @scroll_take_x * $game_system.decel_start
old_display_x = @display_x
# Add onto the deceleration variable
@scroll_decel_x += $game_system.decel_speed
# Work out how much to scroll
distance = [@scroll_take_x - @scroll_decel_x, 4].max
# If the scrolling coordinates are within the map's boundaries
unless @display_x + distance > (self.width - 17) * 256
@display_x += distance
@parallax_x += distance
end
# Subtract the amount that was scrolled
@scroll_remain_x += old_display_x - @display_x
if @scroll_remain_x < 0 then @scroll_remain_x = 0 end
# Otherwise, scroll at a normal speed
else
# Reset the deceleration variable
@scroll_decel_x = 0
# If the scrolling coordinates are out of range
if @display_x + @scroll_take_x > (self.width - 17) * 256
@display_x = (self.width - 20) * 256
@scroll_remain_x = 0
# Otherwise, scroll normally
else
@display_x += @scroll_take_x
@parallax_x += @scroll_take_x
@scroll_remain_x -= @scroll_take_x
end
end
# If the x axis needs to be scrolled to the left
elsif @scroll_remain_x < 0
# If the amount to be scrolled is close enough to 0 to decelerate
if @scroll_remain_x >= [email=-@scroll_take_x]-@scroll_take_x[/email] * $game_system.decel_start
old_display_x = @display_x
# Add onto the deceleration variable
@scroll_decel_x += $game_system.decel_speed
# Work out how much to scroll
distance = [@scroll_take_x - @scroll_decel_x, 4].max
# If the scrolling coordinates are within the map's boundaries
unless @display_x - distance < 0
@display_x -= distance
@parallax_x -= distance
end
# Subtract the amount that was scrolled
@scroll_remain_x += old_display_x - @display_x
if @scroll_remain_x > 0 then @scroll_remain_x = 0 end
# Otherwise, scroll at a normal speed
else
# Reset the deceleration variable
@scroll_decel_x = 0
# If the scrolling coordinates are out of range
if @display_x - @scroll_take_x < 0
@display_x = 0
@scroll_remain_x = 0
# Otherwise, scroll normally
else
@display_x -= @scroll_take_x
@parallax_x -= @scroll_take_x
@scroll_remain_x += @scroll_take_x
end
end
# If no x scrolling needs to be done, reset the deceleration variable
else @scroll_decel_x = 0 end
# If the y axis needs to be scrolled downwards
if @scroll_remain_y > 0
# If the amount to be scrolled is close enough to 0 to decelerate
if @scroll_remain_y <= @scroll_take_y * $game_system.decel_start
old_display_y = @display_y
# Add onto the deceleration variable
@scroll_decel_y += $game_system.decel_speed
# Work out how much to scroll
distance = [@scroll_take_y - @scroll_decel_y, 4].max
# If the scrolling coordinates are within the map's boundaries
unless @display_y + distance > (self.height - 13) * 256
@display_y += distance
@parallax_y += distance
end
# Subtract the amount that was scrolled
@scroll_remain_y += old_display_y - @display_y
if @scroll_remain_y < 0 then @scroll_remain_y = 0 end
# Otherwise, scroll at a normal speed
else
# Reset the deceleration variable
@scroll_speed_accel_y = 0
# If the scrolling coordinates are out of range
if @display_y + @scroll_take_y > (self.height - 13) * 256
@display_y = (self.height - 15) * 256
@scroll_remain_y = 0
# Otherwise, scroll normally
else
@display_y += @scroll_take_y
@parallax_y += @scroll_take_y
@scroll_remain_y -= @scroll_take_y
end
end
# If the y axis needs to be scrolled upwards
elsif @scroll_remain_y < 0
# If the amount to be scrolled is close enough to 0 to decelerate
if @scroll_remain_y >= [email=-@scroll_take_y]-@scroll_take_y[/email] * $game_system.decel_start
old_display_y = @display_y
# Add onto the deceleration variable
@scroll_decel_y += $game_system.decel_speed
# Work out how much to scroll
distance = [@scroll_take_y - @scroll_decel_y, 4].max
# If the scrolling coordinates are within the map's boundaries
unless @display_y - distance < 0
@display_y -= distance
@parallax_y -= distance
end
# Subtract the amount that was scrolled
@scroll_remain_y += old_display_y - @display_y
if @scroll_remain_y > 0 then @scroll_remain_y = 0 end
# Otherwise, scroll at a normal speed
else
# Reset the deceleration variable
@scroll_speed_accel_y = 0
# If the scrolling coordinates are out of range
if @display_y - @scroll_take_y < 0
@display_y = 0
@scroll_remain_y = 0
# Otherwise, scroll normally
else
@display_y -= @scroll_take_y
@parallax_y -= @scroll_take_y
@scroll_remain_y += @scroll_take_y
end
end
# If no y scrolling needs to be done, reset the deceleration variable
else
@scroll_decel_y = 0
end
end
end