Skip to content

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

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.

Yellow star level ups a creature immediately. Do nothing if a creature is already 3rd level.

Orange star fills creature's lives and energy bars immediately.

Green star poisons a creature. Avoid it if possible.

Blue star freezes a creature. Avoid it if possible.

Black star adds 4 dynamites on the map, makes all free bullets rubber and launches them in random directions. Owner of each bullet cleaned before launching, so you won't earn kills points with rubber bullets.

Clone this wiki locally