Class: GamePlay::WorldMap
- Inherits:
-
BaseCleanUpdate::FrameBalanced
- Object
- Base
- BaseCleanUpdate
- BaseCleanUpdate::FrameBalanced
- GamePlay::WorldMap
- Defined in:
- docs/4_Systems_206_TownMap.rb
Overview
Class showing the basic World Map (TownMap) with navigation
The world map is stored inside a 2D Array ($game_data_map) that holds each columns of the world map. Each of these columns contain the ID of the zones at the y position of the cursor
Constant Summary collapse
- ViewportsBaseZ =
Base Z of the viewports
51_000
- VMapX =
Coord X of the map viewport
49
- VMapY =
Coord Y of the map viewport
37
- VMapWidth =
Width of the map viewport
257
- VMapHeight =
Height of the map viewport
168
- UnknownZoneX =
Coord X of the window tell the zone is unkonwn
76
- UnknownZoneY =
Coord Y of the window tell the zone is unkonwn
77
- UnknownZoneWidth =
Width of the window tell the zone is unkonwn
200
- UnknownZoneHeight =
Height of the window tell the zone is unkonwn
30
- CursorAnimationDuration =
Duration of the whole cursor animation
60
- CursorMoveDuration =
frames Duration of the one case move
4
- BitmapOffset =
Offset of the World Map bitmap
0
- TileSize =
8 Size of a tile in the WorldMap (Used outside of the script !)
8
- UI_MAP_HEIGHT =
The height of the display zone on the map window
168
- UI_MAP_WIDTH =
The width of the display zone on the map window
256
- ZoomEnabled =
Indicate if the zoom is usable in world map
true
- PROC_ZONE_COLOR =
Proc to define the zones color
proc do |counter| [1, 0, 0, (300 + counter).to_f / 500] end
- PROC_FLY_ZONE_COLOR =
Proc to define the fly zones color
proc do |counter| [1, 0, 1, (300 + counter * 2).to_f / 600] end
Constants inherited from BaseCleanUpdate
BaseCleanUpdate::AIU_KEY2METHOD
Constants inherited from Base
Base::DEFAULT_TRANSITION, Base::DEFAULT_TRANSITION_PARAMETER
Constants included from Input
Input::ALIAS_KEYS, Input::AXIS_MAPPING, Input::AXIS_SENSITIVITY, Input::DEAD_ZONE, Input::Keyboard, Input::Keys, Input::NON_TRIGGER_ZONE, Input::REPEAT_COOLDOWN, Input::REPEAT_SPACE
Constants included from DisplayMessage
DisplayMessage::MESSAGE_ERROR, DisplayMessage::MESSAGE_PROCESS_ERROR
Instance Attribute Summary
Attributes inherited from Base
#__last_scene, #__result_process, #running, #viewport
Attributes included from DisplayMessage
Instance Method Summary collapse
-
#create_background
Create the Worldmap background.
-
#create_cursor
Create the cursor.
-
#create_frame
Create the frame.
-
#create_graphics
Create all the graphics required by this Scene.
-
#create_map
Create the map sprite.
-
#create_markers
Create the markers (their holder).
-
#create_player_sprite
Create the player marker.
-
#create_viewport
Create the viewports of the scene.
-
#display_custom_icons
Display the customs icons.
-
#display_fly_zones
Display the available fly zones.
-
#display_pokemon_zones
Display the pokedex pokemon zones.
-
#display_roaming_pokemons
Display the roaming pokemon zones and icons.
-
#display_zones(tab)
Create the zones sprites.
-
#dispose
Dispose the scene.
-
#dispose_zone_and_marker
Delete zones and markers sprite.
-
#init_cursor_and_player
Initialize the cursor and the player positions.
-
#initialize(mode = :view, wm_id = $env.get_worldmap, pokemon = nil) ⇒ WorldMap
constructor
Create a new World Map view.
-
#on_fly_attempt
We try to fly to the selected zone.
-
#on_next_worldmap
Load the next worldmap.
-
#on_toggle_zoom
Change the zoom to 0.5 or 1.
-
#process_icon_origin_mode(sprite, ox_mode, oy_mode)
Define the sprite origin with the given parameters.
-
#recenter_map
Reset the map display coords.
-
#search_pokemon_zone ⇒ Table
Search the pokemon encounter zone, return i.
-
#set_bounds
Method retreiving the boundaries of the worldmap.
-
#set_pokemon(pkm, forced_worldmap_id = nil)
Set the pokemon to display.
-
#set_worldmap(id)
Change the display worldmap.
-
#set_zone_rect(zones_tab, x, y, sprite)
Change the zone appearence to match the neighbour.
-
#update_background_animation
Update the background sprite animation.
-
#update_button_input
Update the buttons triggered.
-
#update_cursor_animation
Update the cursor sprite animation.
-
#update_cursor_position_dir8
Update the cursor position using Input.dir8.
-
#update_dir_input
Get the direction 8 input and process it on the cursor.
-
#update_display_origin
Calculate the variables @map_display_ox and @map_display_oy.
-
#update_display_position
Update the map position.
-
#update_graphics
Update the graphics.
-
#update_infobox
Method updating the infobox sprites.
-
#update_inputs
Update the inputs.
-
#update_move
Update the cursor movement.
-
#update_zones_animation
Update the animation of the zones.
-
#visible=(value)
Scene the scene visibility.
Methods inherited from BaseCleanUpdate::FrameBalanced
Methods included from Graphics::FPSBalancer::Marker
Methods inherited from BaseCleanUpdate
#automatic_input_update, #update
Methods inherited from Base
#add_disposable, #call_scene, #find_parent, #main, #return_to_scene, #snap_to_bitmap, #update, #visible
Methods included from Input
dir4, dir8, get_text, joy_axis_position, press?, register_events, released?, repeat?, swap_states, trigger?
Methods included from DisplayMessage
#can_display_message_be_called?, #close_message_window, #display_message, #display_message_and_wait, #message_class, #message_processing?, #message_visible, #message_visible=
Constructor Details
#initialize(mode = :view, wm_id = $env.get_worldmap, pokemon = nil) ⇒ WorldMap
Create a new World Map view
70 71 |
# File 'docs/4_Systems_206_TownMap.rb', line 70 def initialize(mode = :view, wm_id = $env.get_worldmap, pokemon = nil) end |
Instance Method Details
#create_background
Create the Worldmap background
95 96 |
# File 'docs/4_Systems_206_TownMap.rb', line 95 def create_background end |
#create_cursor
Create the cursor
101 102 |
# File 'docs/4_Systems_206_TownMap.rb', line 101 def create_cursor end |
#create_frame
Create the frame
110 111 |
# File 'docs/4_Systems_206_TownMap.rb', line 110 def create_frame end |
#create_graphics
Create all the graphics required by this Scene
92 93 |
# File 'docs/4_Systems_206_TownMap.rb', line 92 def create_graphics end |
#create_map
Create the map sprite
98 99 |
# File 'docs/4_Systems_206_TownMap.rb', line 98 def create_map end |
#create_markers
Create the markers (their holder)
107 108 |
# File 'docs/4_Systems_206_TownMap.rb', line 107 def create_markers end |
#create_player_sprite
Create the player marker
104 105 |
# File 'docs/4_Systems_206_TownMap.rb', line 104 def create_player_sprite end |
#create_viewport
Create the viewports of the scene
89 90 |
# File 'docs/4_Systems_206_TownMap.rb', line 89 def end |
#display_custom_icons
Display the customs icons
170 171 |
# File 'docs/4_Systems_206_TownMap.rb', line 170 def display_custom_icons end |
#display_fly_zones
Display the available fly zones
179 180 |
# File 'docs/4_Systems_206_TownMap.rb', line 179 def display_fly_zones end |
#display_pokemon_zones
Display the pokedex pokemon zones
185 186 |
# File 'docs/4_Systems_206_TownMap.rb', line 185 def display_pokemon_zones end |
#display_roaming_pokemons
Display the roaming pokemon zones and icons
182 183 |
# File 'docs/4_Systems_206_TownMap.rb', line 182 def display_roaming_pokemons end |
#display_zones(tab)
Create the zones sprites
189 190 |
# File 'docs/4_Systems_206_TownMap.rb', line 189 def display_zones(tab) end |
#dispose
Dispose the scene
83 84 |
# File 'docs/4_Systems_206_TownMap.rb', line 83 def dispose end |
#dispose_zone_and_marker
Delete zones and markers sprite
86 87 |
# File 'docs/4_Systems_206_TownMap.rb', line 86 def dispose_zone_and_marker end |
#init_cursor_and_player
Initialize the cursor and the player positions
113 114 |
# File 'docs/4_Systems_206_TownMap.rb', line 113 def init_cursor_and_player end |
#on_fly_attempt
We try to fly to the selected zone
149 150 |
# File 'docs/4_Systems_206_TownMap.rb', line 149 def on_fly_attempt end |
#on_next_worldmap
Load the next worldmap
152 153 |
# File 'docs/4_Systems_206_TownMap.rb', line 152 def on_next_worldmap end |
#on_toggle_zoom
Change the zoom to 0.5 or 1
146 147 |
# File 'docs/4_Systems_206_TownMap.rb', line 146 def on_toggle_zoom end |
#process_icon_origin_mode(sprite, ox_mode, oy_mode)
Define the sprite origin with the given parameters
176 177 |
# File 'docs/4_Systems_206_TownMap.rb', line 176 def process_icon_origin_mode(sprite, ox_mode, oy_mode) end |
#recenter_map
Reset the map display coords
162 163 |
# File 'docs/4_Systems_206_TownMap.rb', line 162 def recenter_map end |
#search_pokemon_zone ⇒ Table
Search the pokemon encounter zone, return i
200 201 |
# File 'docs/4_Systems_206_TownMap.rb', line 200 def search_pokemon_zone end |
#set_bounds
Method retreiving the boundaries of the worldmap
155 156 |
# File 'docs/4_Systems_206_TownMap.rb', line 155 def set_bounds end |
#set_pokemon(pkm, forced_worldmap_id = nil)
Set the pokemon to display
167 168 |
# File 'docs/4_Systems_206_TownMap.rb', line 167 def set_pokemon(pkm, forced_worldmap_id = nil) end |
#set_worldmap(id)
Change the display worldmap
159 160 |
# File 'docs/4_Systems_206_TownMap.rb', line 159 def set_worldmap(id) end |
#set_zone_rect(zones_tab, x, y, sprite)
Change the zone appearence to match the neighbour
196 197 |
# File 'docs/4_Systems_206_TownMap.rb', line 196 def set_zone_rect(zones_tab, x, y, sprite) end |
#update_background_animation
Update the background sprite animation
116 117 |
# File 'docs/4_Systems_206_TownMap.rb', line 116 def update_background_animation end |
#update_button_input
Update the buttons triggered
128 129 |
# File 'docs/4_Systems_206_TownMap.rb', line 128 def end |
#update_cursor_animation
Update the cursor sprite animation
119 120 |
# File 'docs/4_Systems_206_TownMap.rb', line 119 def update_cursor_animation end |
#update_cursor_position_dir8
Update the cursor position using Input.dir8
140 141 |
# File 'docs/4_Systems_206_TownMap.rb', line 140 def update_cursor_position_dir8 end |
#update_dir_input
Get the direction 8 input and process it on the cursor
125 126 |
# File 'docs/4_Systems_206_TownMap.rb', line 125 def update_dir_input end |
#update_display_origin
Calculate the variables @map_display_ox and @map_display_oy
134 135 |
# File 'docs/4_Systems_206_TownMap.rb', line 134 def update_display_origin end |
#update_display_position
Update the map position
137 138 |
# File 'docs/4_Systems_206_TownMap.rb', line 137 def update_display_position end |
#update_graphics
Update the graphics
76 77 |
# File 'docs/4_Systems_206_TownMap.rb', line 76 def update_graphics end |
#update_infobox
Method updating the infobox sprites
143 144 |
# File 'docs/4_Systems_206_TownMap.rb', line 143 def update_infobox end |
#update_inputs
Update the inputs
73 74 |
# File 'docs/4_Systems_206_TownMap.rb', line 73 def update_inputs end |
#update_move
Update the cursor movement
131 132 |
# File 'docs/4_Systems_206_TownMap.rb', line 131 def update_move end |
#update_zones_animation
Update the animation of the zones
122 123 |
# File 'docs/4_Systems_206_TownMap.rb', line 122 def update_zones_animation end |
#visible=(value)
Scene the scene visibility
80 81 |
# File 'docs/4_Systems_206_TownMap.rb', line 80 def visible=(value) end |