맵/타일

월드맵 스크립트

by 아방스 posted Sep 07, 2008
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

# change this to any number less than one to change the size of the world map
# sprites
ZOOM = 0.3
WORLD_IND = '*WORLD*'

class Game_Map
  attr_reader :name
  attr_reader :isworldmap
 
  alias ccoa_setup setup
  #--------------------------------------------------------------------------
  # * Setup
  #     map_id : map ID
  #--------------------------------------------------------------------------
  def setup(map_id)
    ccoa_setup(map_id)
    @name = load_data("Data/MapInfos.rvdata")[@map_id].name
    if @name.include?(WORLD_IND)
      @isworldmap = true
      @name.sub!(WORLD_IND, '')
    else
      @isworldmap = false
    end
  end
end

class Sprite_Character < Sprite_Base
  alias ccoa_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    ccoa_update
    if @character.is_a?(Game_Player) and $game_map.isworldmap
      self.zoom_x = ZOOM
      self.zoom_y = ZOOM
    else
      self.zoom_x = 1.0
      self.zoom_y = 1.0
    end
  end
end