SiliconGhetto Engine API
    Preparing search index...

    Function createSurvivalGame

    • Create a full survival game with health, hunger, inventory, crafting, mobs, and day/night cycle.

      Parameters

      • opts: SurvivalGameOpts = {}

        All voxel world options plus survival-specific settings (health, dayLength)

      Returns Promise<any>

      Game object with sub-APIs: mobs, inventory, recipes, tools, world, player, etc.

      const game = await sg.survival.createSurvivalGame({
      seed: 42,
      health: 20,
      dayLength: 180,
      spawn: [128, 70, 128],
      });
      game.mobs.register('zombie', { health: 20, hostile: true });
      sg.run({ update() { console.log(game.player.getHealth()); } });