-
Notifications
You must be signed in to change notification settings - Fork 13
Objects
AppCraft-LLC edited this page Feb 8, 2018
·
1 revision
Obstacles on map, that make some difficulties to creatures.
Object has the following structure:
* { id: 0, // Unique ID of an object
* position: { x: 10, y: 10 }, // position on the map
* velocity: { x: 10, y: 10 }, // direction of object's movement
* speed: 5, // speed of the object
* bounds: { min: { x: 5, y: 5 }, max: { x: 15, y: 15 } },
* // AABB region of the object
* // min contains left top corner
* // max contains bottom right corner of the rect
* condition: 10, // condition of the object,
* // measured in the same units as lives of creatures
* type: objectTypes.obstacle, // type of the object, can be:
* // objectTypes = { obstacle: 0, dynamite: 1, star: 2 }
* shape: starShapes.levelup // shape of the object, for stars can be:
* // starShapes = { levelup: 0, healing: 1, poisoned: 2, frozen: 3, death: 4 }
* };
Stars are special objects that have good or bad influence on creatures. Stars appears with some probability (starsProbability const in the config.js) from broken objects.





