Global


# Methods

# init (vehicles, cities, passengers, game)

Parameters:
Name Type Description
vehicles Array.<Vehicle>

List of Vehicles that are in this level.

cities Array.<City>

List of Citys that are in this level.

passengers Array.<Passenger>

List of Passengers that are in this level.

game Game

Helper class that provides helpful methods and properties.

Description

This functions gets executed automaticaly when the player presses the "Start" button.

Example
function init (vehicles, cities, passengers, game) {
	let v = vehicles[0];

}



# update (vehicles, cities, passengers, game)

Parameters:
Name Type Description
vehicles Array.<Vehicle>

List of Vehicles that are in this level.

cities Array.<City>

List of Citys that are in this level.

passengers Array.<Passenger>

List of Passengers that are in this level.

game Game

Helper class that provides helpful methods and properties.

Description

This function gets executed every frame. Not generally used, but it exists.

Example
function update (vehicles, cities, passengers, game) {
	let v = vehicles[0];

}



# Type Definitions

# VehicleType

Type: VehicleType
Description

Global ENUM that is used to represent each Vehicle's type.

Example
const VehicleType = {
 CAR: { id: 1, capacity: 4, name: "Car" },
 BUS: { id: 2, capacity: 10, name: "Bus" },
 };
Properties
Name Type Description
CAR object

Default vehicle type

Properties
Name Type Description
id Integer

Type's id (1)

capacity Integer

Type's capacity for passengers (4)

name string

Type's name ("Car")

BUS object

Advanced vehicle type

Properties
Name Type Description
id Integer

Type's id (2)

capacity Integer

Type's capacity for passengers (10)

name string

Type's name ("Bus")