Guest Access
Administrator
Administrator
Administrator
profile
G@MeF@Ce
profile
I know, I've gone platformer crazy! :~p
so much has been learned and discovered
these past few years and lots will be fine tuned, polished and shared.
I've came across a lot of platform scripts for RMXP, usually it's just a script that makes the player jump and only move left to right, but what about the enemies, items, and other events?
Here's a short but sweet script made to give that platform project the gravity it needs. Try it with any platformer script or it with the Pixel Platformer (GPLAT 1 of 2) pixel movement and gravity for the game_player ^,^
enjoy ~
RMXP - EVENT GRAVITY v1.0
screen_shot?
*a special thanks to our mr_wiggles
for making this possible.
so much has been learned and discovered
these past few years and lots will be fine tuned, polished and shared.
I've came across a lot of platform scripts for RMXP, usually it's just a script that makes the player jump and only move left to right, but what about the enemies, items, and other events?
Here's a short but sweet script made to give that platform project the gravity it needs. Try it with any platformer script or it with the Pixel Platformer (GPLAT 1 of 2) pixel movement and gravity for the game_player ^,^
enjoy ~
RMXP - EVENT GRAVITY v1.0
- Code:
#===============================================================================
# Event Gravity script by G@MeF@Ce "GPLAT 2 of 2" http://www.gameface101.com
# special thanks to mr_wiggles for RGSS support
# free to use, must give credit, do not post on any other site
#===============================================================================
module G_EG
GPLAT_SWITCH = 1 #switch ID to turn on/off event gravity
G_GRAVITY = 1 # Y coordinates to
G_DROP = 30 # speed of gravity pull
end
#==============================================================================
# ■ Game_Event
#==============================================================================
class Game_Event < Game_Character
include G_EG
#--------------------------------------------------------------------------
# ● Frame Update
#--------------------------------------------------------------------------
alias gravity_update update
def update
#check_jump_event if $game_switches[GPLAT_SWITCH_ID]
gravity_update
if $game_switches[GPLAT_SWITCH] and $game_map.passable?(@x, @y+1, 2)
@y += 0# if @icon_name != nil
unless @id > 999 or @air_event or @fixed_event
@y += G_GRAVITY
end
end
end
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
alias refresh_gravity refresh
def refresh
refresh_gravity
unless @page == nil
for i in @page.list
if i.code == 108 or i.code == 408
# Code for Air event
if i.parameters[0].upcase[/AIR/] != nil
@air_event = true
end
# Code for Fixed event
if i.parameters[0].upcase[/FIXED/] != nil
@fixed_event = true
end
end
end
end
if @air_event and $game_switches[GPLAT_SWITCH]
if @y != @old_y
case rand(6)
when 0..2; turn_right
when 3..6; turn_left
end
@old_y = @y
end
end
end
end
#==============================================================================
# Game_Character
#==============================================================================
class Game_Character
def update_move
distance = 2 ** @move_speed
if @y * 128 > @real_y
@real_y = [@real_y + distance, @y * 128].min
# event gravity
if self.is_a?(Game_Event) and $game_switches[G_EG::GPLAT_SWITCH] and
@air_event == nil
@real_y += G_EG::G_DROP
end
end
if @x * 128 < @real_x
@real_x = [@real_x - distance, @x * 128].max
end
if @x * 128 > @real_x
@real_x = [@real_x + distance, @x * 128].min
end
if @y * 128 < @real_y
@real_y = [@real_y - distance, @y * 128].max
end
if @walk_anime
@anime_count += 1.5
elsif @step_anime
@anime_count += 1
end
end
end
#end of script ^,^
screen_shot?
- Spoiler:
*a special thanks to our mr_wiggles
for making this possible.
Administrator
Show Signature
EVENTALIST
EVENTALIST
EVENTALIST
profile
mr_wiggles
profile
Looks nice, i see you used proper indentation.
EVENTALIST
Show Signature
EVENTALIST
Administrator
Administrator
Administrator
profile
G@MeF@Ce
profile
wiggles! ha I'm glad you finally took a look, yeah as a noob scripter, I would never care for proper indent, now it's a must.
again, thanks for your help with this one.
I clicked the ["Thanks"] button.
again, thanks for your help with this one.
I clicked the ["Thanks"] button.
Administrator
Show Signature