Camera functionality added
With this we can now fix the camera to a set position. I also added script functions to get the X and Y of an npc, which is useful for events.
This commit is contained in:
parent
6c1f0f8bf4
commit
5d30984821
|
|
@ -56,8 +56,10 @@ class Game_Player < Game_Character
|
||||||
def moveto(x, y)
|
def moveto(x, y)
|
||||||
super
|
super
|
||||||
# Centering
|
# Centering
|
||||||
|
if !$game_switches[100]
|
||||||
center(x, y)
|
center(x, y)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Increaase Steps
|
# * Increaase Steps
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
|
|
@ -227,6 +229,7 @@ class Game_Player < Game_Character
|
||||||
else
|
else
|
||||||
@footstep_timer = 8
|
@footstep_timer = 8
|
||||||
end
|
end
|
||||||
|
if !$game_switches[100]
|
||||||
# If character moves down and is positioned lower than the center
|
# If character moves down and is positioned lower than the center
|
||||||
# of the screen
|
# of the screen
|
||||||
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
|
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
|
||||||
|
|
@ -251,6 +254,7 @@ class Game_Player < Game_Character
|
||||||
# Scroll map up
|
# Scroll map up
|
||||||
$game_map.scroll_up(last_real_y - @real_y)
|
$game_map.scroll_up(last_real_y - @real_y)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
# If not moving
|
# If not moving
|
||||||
unless moving?
|
unless moving?
|
||||||
# If player was moving last time
|
# If player was moving last time
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,24 @@ module Script
|
||||||
logpos($game_player.y, $game_player.real_y, $game_player.direction == 2)
|
logpos($game_player.y, $game_player.real_y, $game_player.direction == 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.eve_x(name)
|
||||||
|
for event in $game_map.events.values
|
||||||
|
if event.name == name
|
||||||
|
return logpos(event.x, event.real_x, event.direction == 6)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.eve_y(name)
|
||||||
|
for event in $game_map.events.values
|
||||||
|
if event.name == name
|
||||||
|
return logpos(event.y, event.real_y, event.direction == 2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
# Temporary switch assignment
|
# Temporary switch assignment
|
||||||
def self.tmp_s1=(val)
|
def self.tmp_s1=(val)
|
||||||
$game_switches[TMP_INDEX+0] = val
|
$game_switches[TMP_INDEX+0] = val
|
||||||
|
|
@ -44,6 +62,11 @@ module Script
|
||||||
end
|
end
|
||||||
return pos
|
return pos
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.set_cam(x, y)
|
||||||
|
$game_map.display_x = x
|
||||||
|
$game_map.display_y = y
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_lightbulb?
|
def has_lightbulb?
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue