Class: Game_Map

Game_Map()

new Game_Map()

The game object declare class for a map. It contains scrolling and passage determination functions. Use as global variable $gameMap
Properties:
Name Type Description
_interpreter Game_Interpreter
_mapId Number
_tilesetId Number
_events Array.<Game_Event>
_commonEvents Array.<Game_CommonEvent>
_vehicles Array.<Game_Vehicle>
_displayX Number
_displayY Number
_nameDisplay Boolean
_scrollDirection Number
_scrollRest Number
_scrollSpeed Number
_parallaxName String
_parallaxZero Boolean
_parallaxLoopX Boolean
_parallaxLoopY Boolean
_parallaxSx Number
_parallaxSy Number
_parallaxX Number
_parallaxY Number
_battleback1Name String
_battleback2Name String
_needsRefresh Boolean

Methods

adjustX(x) → {Number}

Parameters:
Name Type Description
x Number
Returns:
Type
Number

adjustY(y) → {Number}

Parameters:
Name Type Description
y Number
Returns:
Type
Number

airship() → {Game_Vehicle}

Returns the game airship.
Returns:
Type
Game_Vehicle

allTiles(x, y) → {Array.<Number>}

Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Array.<Number>

autoplay()

Auto plays the game map.

autotileType(x, y, z) → {Number}

Parameters:
Name Type Description
x Number
y Number
z Number
Returns:
Type
Number

battleback1Name() → {String}

Returns the name of battle back 1.
Returns:
Type
String

battleback2Name() → {String}

Returns the name of battle back 2.
Returns:
Type
String

boat() → {Game_Vehicle}

Returns the game boat.
Returns:
Type
Game_Vehicle

canvasToMapX(x) → {Number}

Converts the x coordinate from canvas to map coordinate x.
Parameters:
Name Type Description
x Number
Returns:
Type
Number

canvasToMapY(y) → {Number}

Converts the y coordinate from canvas to map y coordinate.
Parameters:
Name Type Description
y Number
Returns:
Type
Number

changeBattleback(battleback1Name, battleback2Name)

Parameters:
Name Type Description
battleback1Name String
battleback2Name String

changeParallax(name, loopX, loopY, sx, sy)

Parameters:
Name Type Description
name String
loopX Boolean
loopY Boolean
sx Number
sy Number

changeTileset(tilesetId)

Changes them ap tileset, given the tileset id.
Parameters:
Name Type Description
tilesetId Number

checkLayeredTilesFlags(x, y, bit) → {Boolean}

Parameters:
Name Type Description
x Number
y Number
bit Number
Returns:
Type
Boolean

checkPassage(x, y, bit)

Parameters:
Name Type Description
x Number
y Number
bit Number

createVehicles()

Creates the vehicles for the game map.

data() → {Array.<number>}

Returns the map data.
Returns:
Type
Array.<number>

deltaX(x1, x2) → {Number}

Parameters:
Name Type Description
x1 Number
x2 Number
Returns:
Type
Number

deltaY(y1, y2) → {Number}

Parameters:
Name Type Description
y1 Number
y2 Number
Returns:
Type
Number

disableNameDisplay()

Disables name display.

displayName() → {String}

Returns the display name of the game map.
Returns:
Type
String

displayX() → {Number}

Returns the display x coordinate.
Returns:
Type
Number

displayY() → {Number}

Returns the display y coordinate.
Returns:
Type
Number

distance(x1, x2, y1, y2) → {Number}

Parameters:
Name Type Description
x1 Number
x2 Number
y1 Number
y2 Number
Returns:
Type
Number

doScroll(direction, distance)

Parameters:
Name Type Description
direction Number
distance Number

enableNameDisplay()

Enable name display.

encounterList() → {Array.<RPG.Map.Encounter>}

Returns the list of possible encounters on the current map.
Returns:
Type
Array.<RPG.Map.Encounter>

encounterStep() → {Number}

Returns the number of encounter steps on the map.
Returns:
Type
Number

eraseEvent(eventId)

Erases the event given the event id.
Parameters:
Name Type Description
eventId Number

event(eventId) → {Game_Event}

Returns an event, given the event id.
Parameters:
Name Type Description
eventId Number
Returns:
Type
Game_Event

eventIdXy(x, y) → {Number}

Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Number

events() → {Array.<Game_Event>}

Returns all events on the game map.
Returns:
Type
Array.<Game_Event>

eventsXy(x, y) → {Array.<Game_Event>}

Returns the game events at the specified x and y position.
Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Array.<Game_Event>

eventsXyNt(x, y) → {Array.<Game_Event>}

Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Array.<Game_Event>

height() → {Number}

Returns the map height.
Returns:
Type
Number

initialize()

isAirshipLandOk(x, y) → {Boolean}

Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Boolean

isAnyEventStarting() → {Boolean}

Returns true if any event is starting on the map.
Returns:
Type
Boolean

isBoatPassable(x, y) → {Boolean}

Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Boolean

isBush(x, y) → {Boolean}

Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Boolean

isCounter(x, y) → {Boolean}

Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Boolean

isDamageFloor(x, y) → {Boolean}

Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Boolean

isDashDisabled() → {Boolean}

Returns true if dash is disabled on the map.
Returns:
Type
Boolean

isEventRunning() → {Boolean}

Returns true if an event is running.
Returns:
Type
Boolean

isLadder(x, y) → {Boolean}

Returns true if the specified element at the given x and y coordinates is a ladder.
Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Boolean

isLoopHorizontal() → {Boolean}

Returns true if the map loops horizontally.
Returns:
Type
Boolean

isLoopVertical() → {Boolean}

Returns true if the map loops vertically.
Returns:
Type
Boolean

isNameDisplayEnabled() → {Boolean}

Returns true if the name display is enabled.
Returns:
Type
Boolean

isOverworld() → {Boolean}

Returns true if the map is an over world map.
Returns:
Type
Boolean

isPassable(x, y, d) → {Boolean}

Parameters:
Name Type Description
x Number
y Number
d Number
Returns:
Type
Boolean

isScrolling() → {Boolean}

Returns:
Type
Boolean

isShipPassable(x, y) → {Boolean}

Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Boolean

isValid(x, y) → {Boolean}

Returns true if the x and y coordinates are valid.
Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Boolean

layeredTiles(x, y) → {Array.<Number>}

Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Array.<Number>

mapId() → {Number}

Returns map id.
Returns:
Type
Number

parallaxName() → {String}

Returns:
Type
String

parallaxOx() → {Number}

Returns:
Type
Number

parallaxOy() → {Number}

Returns:
Type
Number

parallelCommonEvents() → {Array.<RPG.CommonEvent>}

Returns all the parallel running common events.
Returns:
Type
Array.<RPG.CommonEvent>

refereshVehicles()

Refreshes the vehicles on the game map.

refresh()

refreshIfNeeded()

refreshTileEvents()

regionId(x, y) → {Number}

Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Number

requestRefresh(mapId)

Parameters:
Name Type Description
mapId Number

roundX(x) → {Number}

Parameters:
Name Type Description
x Number
Returns:
Type
Number

roundXWithDirection(x, d) → {Number}

Parameters:
Name Type Description
x Number
d Number
Returns:
Type
Number

roundY(y) → {Number}

Parameters:
Name Type Description
y Number
Returns:
Type
Number

roundYWithDirection(y, d) → {Number}

Parameters:
Name Type Description
y Number
d Number
Returns:
Type
Number

screenTileX() → {Number}

Returns the screen tile x coordinate.
Returns:
Type
Number

screenTileY() → {Number}

Returns the screen tile y coordinate.
Returns:
Type
Number

scrollDistance() → {Number}

Returns:
Type
Number

scrollDown(distance)

Parameters:
Name Type Description
distance Number

scrollLeft(distance)

Parameters:
Name Type Description
distance Number

scrollRight(distance)

Parameters:
Name Type Description
distance Number

scrollUp(distance)

Parameters:
Name Type Description
distance Number

setDisplayPos(x, y)

Parameters:
Name Type Description
x Number
y Number

setup(mapId)

Parameters:
Name Type Description
mapId Number

setupAutorunCommonEvent() → {Boolean}

Sets up an auto run common event.
Returns:
Type
Boolean

setupBattleback()

setupEvents()

setupParallax()

setupScroll()

setupStartingEvent() → {Boolean}

Returns:
Type
Boolean

setupStartingMapEvent() → {Boolean}

Returns:
Type
Boolean

setupTestEvent() → {Boolean}

Returns:
Type
Boolean

ship() → {Game_Vehicle}

Returns the game ship.
Returns:
Type
Game_Vehicle

startScroll(direction, distance, speed)

Parameters:
Name Type Description
direction Number
distance Number
speed Number

terrainTag(x, y) → {Number}

Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Number

tileEventsXy(x, y) → {Array.<Game_Event>}

Parameters:
Name Type Description
x Number
y Number
Returns:
Type
Array.<Game_Event>

tileHeight() → {Number}

Returns tile height.
Returns:
Type
Number

tileId(x, y, z) → {Number}

Returns the tile id at the specified x, y, and z coordinates.
Parameters:
Name Type Description
x Number
y Number
z Number
Returns:
Type
Number

tileset() → {RPG.Tileset}

Returns the tilset of the game map.
Returns:
Type
RPG.Tileset

tilesetFlags() → {Array.<number>}

Returns the tileset flags of the game map.
Returns:
Type
Array.<number>

tilesetId() → {Number}

Returns the tileset id.
Returns:
Type
Number

tileWidth() → {Number}

Returns tile width.
Returns:
Type
Number

unlockEvent(eventId)

Unlocks an event on the map given the event id.
Parameters:
Name Type Description
eventId Number

update(sceneActive)

Updates the game map, given that the scene is active.
Parameters:
Name Type Description
sceneActive Boolean

updateEvents()

Updates all events on the map.

updateInterpreter()

Updates the map's game interpreter.

updateParallax()

Updates the map parallaxes.

updateScroll()

updateVehicles()

Updates all game vehicles on the map.

vehicle(type) → {Game_Vehicle}

Returns the game vehicle specified by type.
Parameters:
Name Type Description
type String
Returns:
Type
Game_Vehicle

vehicles() → {Array.<Game_Vehicle>}

Returns:
Type
Array.<Game_Vehicle>

width() → {Number}

Returns the map width.
Returns:
Type
Number

xWithDirection(x, d) → {Number}

Parameters:
Name Type Description
x Number
d Number
Returns:
Type
Number

yWithDirection(y, d) → {Number}

Parameters:
Name Type Description
y Number
d Number
Returns:
Type
Number