Skip to content

Worlds Code

Adam White edited this page Oct 22, 2017 · 6 revisions

World

A world represents a world described in Portals and Worlds Each world has entities and managers linked to it. Entities that are in the current world will be rendered, all other entities will not be rendered.

Useful Methods

Method Description
addEntity Adds the given entity to the world, to be rendered when the world is rendered
removeEntity Removes the given entity from the world
getTile Gets the terrain object for the specified location

World Manager

The world manager stored and generates all the worlds. The world can be changed with setWorld where the world type to change to is specified. When changing worlds, the world manager stores all managers with the interface ForWorld on the old world before changing worlds.

The methods getRandomGrid and getRandomGridEdge will return random grids from GridUtil the same size as the world much faster than generating another one. Currently, only a fixed amount are created so multiple calls are likely to return the same grids.

World Types

WorldTypes

UML Class Model

The methods and class interactions are shown in this diagram.


Gameplay

Design

Asset Creation

User Testing

Code Guidelines


http://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gif

Clone this wiki locally