0.37.0 • Published 6 years ago

tgan-entities v0.37.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
6 years ago

The Game About Nothing is an open hobby project owned by its contributors. The project is about creating a flexible, persistent virtual world, providing entertaining gaming experiences using web technology. For more info, see nothing.rocks.

Elements

Objects and functions making up the main elements used in the game world. Includes all the entity classes, actions and the rest of the game world logic.

Objects should be decoupled and not be aware of their environment/surroundings other than the relevant data sent by arguments or fetched from Origin. This way, entities can be used as part of a larger setup like in the back end api, or they can be used in a closed context like a test simulation or an example code running independent of any game world environment.

Class/display names of entities should be named based on human terms. If two different entity types have a possible name conflict, human terms should be the basis for setting unique names.

Entity properties

All "public" properties that is a direct property related to the entity and its function, should be enumerable properties. Other more internal properties should be non-enumerable, like type and events.

All properties should be primitive values as far as possible. This makes the data structures simpler, and reduce maintenance (i.e avoiding issues related to immutability).

Entities might have default static properties, that can be overrided based on other properties. Like having an average walking speed for a human entity objects, and then if one entity has high fitness properties, that can be a basis for calculating a higher average walking speed for that single human entity.

Some properties or other entity data might come in different forms. This is to be able to create different forms of interfaces and editing techniques. For instance, environments like a room, have outer border properties defining the max x/y/z coordinates, practically making it a box shape. However, the actual shape detailed in vertices/faces will often be much more detailed. But still, some operations might just require the outer dimensions of the entity, so using the simplified coordinates is enough.

Properties is in the code (variable names, attributes, object keys etc) are usually called props

Installation

npm install tgan-elements

This module does not have any dist folder/file. This is because the tgan-modules are interconnected and work best when built into an application bundle (like using webpack). For usage without a build step, the bundle module contain all the tgan modules bundled into one global package.

License

The module is licensed under a modified open source license. Copyright (c) 2015, Henrik Haugberg. For more information, see our Guidelines.