Icy Floors
Version - 1
By Saucetenuto and Compiled by Syvkal
Introduction I have taken Saucetenuto's original coding sections and brought them into one script that is now easy to use.
Features
Slippy tiles with the properties of ice
Customisable terrain tag in script
Script
"Icy Floors"
Code:
#==============================================================================
# ** Icy Floors V1
# By Saucetenuto and Compiled by Syvkal
#------------------------------------------------------------------------------
# This enables floors to have properties of Ice and you slide across them
#==============================================================================
#--------------------------------------------------------------------------
# Change this Number to the terrain tag you want to be slippy
ICE = 1
#--------------------------------------------------------------------------
class Game_Player < Game_Character
alias update_normal update
def update
update_normal
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
if $game_map.terrain_tag(@x, @y) == ICE and passable?(@x, @y, @direction)
dir = @direction
else
dir = Input.dir4
end
case dir
when 2
move_down
when 4
move_left
when 6
move_right
when 8
move_up
end
end
end
end
class Game_Character
def refresh_walk_anime(old_x, old_y)
if $game_map.terrain_tag(old_x, old_y) == ICE and $game_map.terrain_tag(@x, @y) != 1
@walk_anime = true
elsif $game_map.terrain_tag(@x, @y) == ICE
@walk_anime = false
end if self.is_a?(Game_Player)
end
alias move_down_normal move_down
def move_down(turn_enabled = true)
turn_down if turn_enabled
if passable?(@x, @y, 2)
turn_down
@y += 1
refresh_walk_anime(@x, @y-1)
increase_steps
else
check_event_trigger_touch(@x, @y+1)
end
end
alias move_left_normal move_left
def move_left(turn_enabled = true)
turn_left if turn_enabled
if passable?(@x, @y, 4)
turn_left
@x -= 1
refresh_walk_anime(@x+1, @y)
increase_steps
else
check_event_trigger_touch(@x-1, @y)
end
end
alias move_right_normal move_right
def move_right(turn_enabled = true)
turn_right if turn_enabled
if passable?(@x, @y, 6)
turn_right
@x += 1
refresh_walk_anime(@x-1, @y)
increase_steps
else
check_event_trigger_touch(@x+1, @y)
end
end
alias move_up_normal move_up
def move_up(turn_enabled = true)
turn_up if turn_enabled
if passable?(@x, @y, 8)
turn_up
@y -= 1
refresh_walk_anime(@x, @y+1)
increase_steps
else
check_event_trigger_touch(@x, @y-1)
end
end
end
Enjoy ^_^
Just a note...
I hope there aren't any scripting problems, because I don't think there are.
I'll be happy to help with any problems, whether I can is another matter...