Class: GamePlay::WorldMap

Inherits:
BaseCleanUpdate::FrameBalanced show all
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

Returns:

  • (Integer)
51_000
VMapX =

Coord X of the map viewport

Returns:

  • (Integer)
49
VMapY =

Coord Y of the map viewport

Returns:

  • (Integer)
37
VMapWidth =

Width of the map viewport

Returns:

  • (Integer)
257
VMapHeight =

Height of the map viewport

Returns:

  • (Integer)
168
UnknownZoneX =

Coord X of the window tell the zone is unkonwn

Returns:

  • (Integer)
76
UnknownZoneY =

Coord Y of the window tell the zone is unkonwn

Returns:

  • (Integer)
77
UnknownZoneWidth =

Width of the window tell the zone is unkonwn

Returns:

  • (Integer)
200
UnknownZoneHeight =

Height of the window tell the zone is unkonwn

Returns:

  • (Integer)
30
CursorAnimationDuration =

Duration of the whole cursor animation

Returns:

  • (Integer)
60
CursorMoveDuration =

frames Duration of the one case move

Returns:

  • (Integer)
4
BitmapOffset =

Offset of the World Map bitmap

Returns:

  • (Integer)
0
TileSize =

8 Size of a tile in the WorldMap (Used outside of the script !)

Returns:

  • (Integer)
8
UI_MAP_HEIGHT =

The height of the display zone on the map window

Returns:

  • (Integer)
168
UI_MAP_WIDTH =

The width of the display zone on the map window

Returns:

  • (Integer)
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

#message_window

Instance Method Summary collapse

Methods inherited from BaseCleanUpdate::FrameBalanced

#update

Methods included from Graphics::FPSBalancer::Marker

#frame_balanced?

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

Parameters:

  • mode (Symbol) (defaults to: :view)

    mode of the World Map (:view / :fly / :pokdex / :view_wall)

  • wm_id (Integer) (defaults to: $env.get_worldmap)

    the id of the world map to display

  • pokemon (PFM::Pokemon, Symbol) (defaults to: nil)

    <default :map> the calling situation



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 create_viewport
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

Parameters:

  • tab (Table)

    the table containing the data : 0=no zone, 1=zone



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

Parameters:

  • sprite (Sprite)

    the sprite to modify

  • ox_mode (Symbol)
  • oy_mode (Symbol)


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_zoneTable

Search the pokemon encounter zone, return i

Returns:

  • (Table)

    the table where the pokemon spawn



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

Parameters:

  • pkm (PFM::Pokemon)

    the pokemon object

  • forced_worldmap_id (Integer, nil) (defaults to: nil)

    the worldmap to display, if nil, the best one will be picked



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

Parameters:

  • id (Integer)

    the worldmap id to display



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

Parameters:

  • zones_tab (Table)

    the zones data

  • x (Integer)

    the x coord

  • y (Integer)

    the y coord

  • sprite (Sprite)

    the sprite to setup



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 update_button_input
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

Parameters:

  • value (Boolean)


80
81
# File 'docs/4_Systems_206_TownMap.rb', line 80

def visible=(value)
end