ice.level - ICE 0.1 API documentation

ICE 0.1 API documentation

# ice.level

Handles execution of a single game level.

class LevelInitException: object.Exception;

  Thrown when the level fails to initialize.

abstract class Level;

  Handles execution of a single game level.

  Note that it is expected to explicitly destroy the Level using clear() once it is not used anymore.

  protected const string name_;

    Name of the level (used for debugging).

  protected GameSubsystems subsystems_;

    Provides access to game subsystems (such as EntitySystem, VideoDriver, etc.).

  pure nothrow this(string name, GameSubsystems subsystems);

    Construct a Level.

    Parameters:

    string name | Name of the level.
    GameSubsystems subsystems | Provides access to game subsystems (e.g. EntitySystem to spawn entities).

  bool update();

    Update the level state, executing level script.

    This might spawn new enemies, display text, etc.

    Returns:
    true if the level is still running, false if the level has been finished.
class DumbLevel: ice.level.Level;

  Level implementation based on a dumb YAML script.

  Described in more detail in modding documentation.

  this(string levelName, Node yaml, GameSubsystems gameSybsystems, Node playerSpawnerSource);

    Construct a DumbLevel.

    Parameters:

    string levelName | Name of the level (used for debugging).
    Node yaml | YAML source of the level.
    subsystems | Provides access to game subsystems (e.g. EntitySystem to spawn entities).
    Node playerSpawnerSource | YAML source of an entity to spawn the player ship.

    Throws:
    LevelInitException on failure.

Copyright © Ferdinand Majerech 2011. | Page generated by AutoDDoc and Ddoc.