EndGame

EndGame

Ends the game with a victory screen when a matching color event is received.

Typical use: trigger the win condition — e.g. place this on the final objective cell and fire its color event when the player delivers the last required item or solves the final puzzle.

Constructor

new EndGame(terrain, color, url)

Source:
Parameters:
Name Type Description
terrain Terrain

The underlying terrain this decorator wraps.

color Color

The color event that triggers the game-over screen.

url string

URL of the victory page passed to game.gameOver.

Extends

Classes

EndGame

Members

terrain :Terrain

Source:
Overrides:
Type:

Methods

getProxiedTerrain()

Description:
  • Return the terrain being wrapped (TerrainProxy interface).

Source:
Overrides:

onColorEventInternal(event, color, _cell)

Description:
  • Calls game.gameOver with the victory URL when the received color matches EndGame#color.

Source:
Parameters:
Name Type Description
event GameEvent

Unused.

color Color
_cell Cell

Unused.