Class: RPG::Map
- Inherits:
-
Object
- Object
- RPG::Map
- Defined in:
- lib/rpg/map.rb
Instance Attribute Summary collapse
-
#autoplay_bgm ⇒ Object
Truth-value of whether BGM autoswitching is enabled.
-
#autoplay_bgs ⇒ Object
Truth-value of whether BGS autoswitching is enabled.
-
#bgm ⇒ Object
If BGM autoswitching is enabled, the name of that BGM (AudioFile).
-
#bgs ⇒ Object
If BGS autoswitching is enabled, the name of that BGS (AudioFile).
-
#data ⇒ Object
The map data.
-
#encounter_list ⇒ Object
Encounter list.
-
#encounter_step ⇒ Object
Number of steps between encounters.
-
#events ⇒ Object
Map events.
-
#height ⇒ Object
The map height.
-
#tileset_id ⇒ Object
Tileset ID to be used in the map.
-
#width ⇒ Object
The map width.
Instance Method Summary collapse
-
#initialize(width, height) ⇒ Map
constructor
A new instance of Map.
Constructor Details
#initialize(width, height) ⇒ Map
Returns a new instance of Map.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rpg/map.rb', line 5 def initialize(width, height) @tileset_id = 1 @width = width @height = height @autoplay_bgm = false @bgm = RPG::AudioFile.new @autoplay_bgs = false @bgs = RPG::AudioFile.new("", 80) @encounter_list = [] @encounter_step = 30 @data = Table.new(width, height, 3) @events = {} end |
Instance Attribute Details
#autoplay_bgm ⇒ Object
Truth-value of whether BGM autoswitching is enabled.
29 30 31 |
# File 'lib/rpg/map.rb', line 29 def autoplay_bgm @autoplay_bgm end |
#autoplay_bgs ⇒ Object
Truth-value of whether BGS autoswitching is enabled.
35 36 37 |
# File 'lib/rpg/map.rb', line 35 def autoplay_bgs @autoplay_bgs end |
#bgm ⇒ Object
If BGM autoswitching is enabled, the name of that BGM (AudioFile).
32 33 34 |
# File 'lib/rpg/map.rb', line 32 def bgm @bgm end |
#bgs ⇒ Object
If BGS autoswitching is enabled, the name of that BGS (AudioFile).
38 39 40 |
# File 'lib/rpg/map.rb', line 38 def bgs @bgs end |
#data ⇒ Object
The map data. A 3-dimensional tile ID Table.
47 48 49 |
# File 'lib/rpg/map.rb', line 47 def data @data end |
#encounter_list ⇒ Object
Encounter list. A troop ID array.
41 42 43 |
# File 'lib/rpg/map.rb', line 41 def encounter_list @encounter_list end |
#encounter_step ⇒ Object
Number of steps between encounters.
44 45 46 |
# File 'lib/rpg/map.rb', line 44 def encounter_step @encounter_step end |
#events ⇒ Object
Map events. A hash that represents Event instances as values, using event IDs as the keys.
51 52 53 |
# File 'lib/rpg/map.rb', line 51 def events @events end |
#height ⇒ Object
The map height.
26 27 28 |
# File 'lib/rpg/map.rb', line 26 def height @height end |
#tileset_id ⇒ Object
Tileset ID to be used in the map.
20 21 22 |
# File 'lib/rpg/map.rb', line 20 def tileset_id @tileset_id end |
#width ⇒ Object
The map width.
23 24 25 |
# File 'lib/rpg/map.rb', line 23 def width @width end |