#==============================================================================
# ** Game_Character (part 3)
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass for the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Move Half Down
# turn_enabled : a flag permits direction change on that spot
#--------------------------------------------------------------------------
def move_half_down(turn_enabled = true)
# Turn down
if turn_enabled
turn_down
end
# If passable
if passable?(@x, @y, 2)
# Turn down
turn_down
# Update coordinates
@y += 0.16
# Increase half asteps
increase_steps
# If impassable
else
# Determine if touch event is triggered
check_event_trigger_touch(@x, @y+1)
end
end
#--------------------------------------------------------------------------
# * Move Half Left
# turn_enabled : a flag permits direction change on that spot
#--------------------------------------------------------------------------
def move_half_left(turn_enabled = true)
# Turn left
if turn_enabled
turn_left
end
# If passable
if passable?(@x, @y, 4)
# Turn left
turn_left
# Update coordinates
@x -= 0.16
# Increase half asteps
increase_steps
# If impassable
else
# Determine if touch event is triggered
check_event_trigger_touch(@x-1, @y)
end
end
#--------------------------------------------------------------------------
# * Move Half Right
# turn_enabled : a flag permits direction change on that spot
#--------------------------------------------------------------------------
def move_half_right(turn_enabled = true)
# Turn right
if turn_enabled
turn_right
end
# If passable
if passable?(@x, @y, 6)
# Turn right
turn_right
# Update coordinates
@x += 0.16
# Increase half asteps
increase_steps
# If impassable
else
# Determine if touch event is triggered
check_event_trigger_touch(@x+1, @y)
end
end
#--------------------------------------------------------------------------
# * Move Half Up
# turn_enabled : a flag permits direction change on that spot
#--------------------------------------------------------------------------
def move_half_up(turn_enabled = true)
# Turn up
if turn_enabled
turn_up
end
# If passable
if passable?(@x, @y, 8)
# Turn up
turn_up
# Update coordinates
@y -= 0.16
# Increase half a steps
increase_steps
# If impassable
else
# Determine if touch event is triggered
check_event_trigger_touch(@x, @y-1)
end
end
end