0% found this document useful (0 votes)
16 views2 pages

Stairs

The document defines two methods, move_left and move_right, that control movement of a player character on a map. Both methods check terrain tags, turn the player in the appropriate direction, update position coordinates, and call other methods to handle dependent events and increment steps.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

Stairs

The document defines two methods, move_left and move_right, that control movement of a player character on a map. Both methods check terrain tags, turn the player in the appropriate direction, update position coordinates, and call other methods to handle dependent events and increment steps.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

def move_left(turn_enabled = true)

if turn_enabled
turn_left
end
x = $game_player.x
y = $game_player.y
if $game_map.terrain_tag(x,y)==24 && $game_map.terrain_tag(x-1,y-1)==24
turn_left
@x -= 1
@y -= 1
$PokemonTemp.dependentEvents.pbMoveDependentEvents
increase_steps
elsif $game_map.terrain_tag(x,y)==25 && $game_map.terrain_tag(x-1,y+1)==25
turn_left
@x -= 1
@y += 1
$PokemonTemp.dependentEvents.pbMoveDependentEvents
increase_steps
elsif passable?(@x, @y, 4)
return if pbLedge(-1,0)
return if pbEndSurf(-1,0)
turn_left
@x -= 1
$PokemonTemp.dependentEvents.pbMoveDependentEvents
increase_steps
else
if !check_event_trigger_touch(@x-1, @y)
if !@bump_se || @bump_se<=0
pbSEPlay("bump"); @bump_se=10
end
end
end
end

def move_right(turn_enabled = true)


if turn_enabled
turn_right
end
x = $game_player.x
y = $game_player.y
if $game_map.terrain_tag(x,y)==24 && $game_map.terrain_tag(x+1,y+1)==24
turn_right
@x += 1
@y += 1
$PokemonTemp.dependentEvents.pbMoveDependentEvents
increase_steps
elsif $game_map.terrain_tag(x,y)==25 && $game_map.terrain_tag(x+1,y-1)==25
turn_right
@x += 1
@y -= 1
$PokemonTemp.dependentEvents.pbMoveDependentEvents
increase_steps
elsif passable?(@x, @y, 6)
return if pbLedge(1,0)
return if pbEndSurf(1,0)
turn_right
@x += 1
$PokemonTemp.dependentEvents.pbMoveDependentEvents
increase_steps
else
if !check_event_trigger_touch(@x+1, @y)
if !@bump_se || @bump_se<=0
pbSEPlay("bump"); @bump_se=10
end
end
end
end

You might also like