Overview

End the game in either victory or defeat.

(info) The game rules (rules.js) determine when a game is over and call this function accordingly.

Availability

Warzone 3.1 Beta 1 and above.

Syntax

var returnValue = gameOverMessage(won);

Parameters

ParameterTypeMandatoryDescriptionGame version
wonBoolean(tick)

Has the player won the game?

  • true – game won: "Mission Successful"
  • false – game lost: "Mission Failed"
3.1 Beta 1

Return values

ValueTypeDescriptionGame version
undefinedUndefinedThe function does not return a value.3.1 Beta 1

Example

See the checkEndConditions function in rules.js.

See also