diff --git a/scripts/Sprite_Character.rb b/scripts/Sprite_Character.rb index 9334afc..b5aa42f 100644 --- a/scripts/Sprite_Character.rb +++ b/scripts/Sprite_Character.rb @@ -94,6 +94,15 @@ class Sprite_Character end end #-------------------------------------------------------------------------- + # * Frame Update Fast (only position) + #-------------------------------------------------------------------------- + def update_fast + # Set sprite coordinates + self.x = @character.screen_x + self.y = @character.screen_y + self.z = @character.screen_z(@ch) + end + #-------------------------------------------------------------------------- # * Sprite attribute wrapper #-------------------------------------------------------------------------- def self.sprite_attr(*args) diff --git a/scripts/Spriteset_Map.rb b/scripts/Spriteset_Map.rb index 9380ad6..0ea9141 100644 --- a/scripts/Spriteset_Map.rb +++ b/scripts/Spriteset_Map.rb @@ -242,21 +242,23 @@ class Spriteset_Map @fog.tone = $game_map.fog_tone # Update character sprites @character_sprites.each do |sprite| - if !sprite.character.is_a?(Game_Event) - sprite.update - elsif + if !sprite.character.is_a?(Game_Event) + sprite.update + elsif - # this is just a check to make sure the sprite is onscreen for game events - # based on its current width and height - # no point in updating the sprite if offscreen - # this greatly increases performance on larger maps + # this is just a check to make sure the sprite is onscreen for game events + # based on its current width and height + # no point in updating the sprite if offscreen + # this greatly increases performance on larger maps - ((sprite.character.real_x + (sprite.ox*4) > $game_map.display_x - 128) && - (sprite.character.real_x - (sprite.ox*4) < $game_map.display_x + (21 * 128)) && - (sprite.character.real_y + (sprite.oy*4) > ($game_map.display_y) - 128) && - (sprite.character.real_y - (sprite.oy*4) < ($game_map.display_y) + (17 * 128))) - sprite.update - end + ((sprite.character.real_x + (sprite.ox*4) > $game_map.display_x - 128) && + (sprite.character.real_x - (sprite.ox*4) < $game_map.display_x + (21 * 128)) && + (sprite.character.real_y + (sprite.oy*4) > ($game_map.display_y) - 128) && + (sprite.character.real_y - (sprite.oy*4) < ($game_map.display_y) + (17 * 128))) + sprite.update + else + sprite.update_fast + end end # Update footprints @footprint_sprites.delete_if do |sprite|