Indigo

Indigo

  • GitHub
  • Docs
  • Tools

›Presentation

Indigo

  • Indigo's Development Status

Getting started

  • Setup & Configuration
  • Hello, Indigo!
  • Examples
  • Mill & SBT Game Templates

Organising your game

  • Boot & Start Up
  • Game Entry Points
  • Scenes & Scene Management
  • SubSystems

The game loop

  • Events
  • Frame context
  • Outcome Type

Presentation

  • Animation
  • Audio
  • Depth & Layers
  • Effects
  • Lighting
  • Materials
  • Primitives & Building Blocks
  • SceneUpdateFragment Type
  • Text & Fonts
  • UI Components

Working with Time

  • Signals & Signal Functions
  • Time Varying Values

Platform & Publishing

  • Assets & Asset Loading
  • Cross Platform Publishing
  • File Format Importers
  • User Input Handling
  • Loading & Saving Data
  • Logging
  • Networking

Other information

  • Alternatives to Indigo
  • Glossary
  • Key Concepts
  • Model, ViewModel, & View
  • Motivation & Constraints
  • Performance
  • Prior Art
  • Rendering Technology

Audio

Indigo's audio support is fairly unsophisticated, but probably good enough for the kind of games Indigo was designed for. The authors are not audio experts, please feel free to raise issues if you have any suggestions for improvements.

There are two kinds of audio support in Indigo:

  1. Sound effects
  2. Background music

Audio formats

Indigo uses web technologies, so you should refer to current recommended practices for audio formats. That being said, anything a browser will play Indigo will play, and most of the existing demos and examples just use MP3 files, but that is a fairly dated format these days.

Please refer to the assets documentation for information on how to load audio files.

Sound effects

Sound effects are tiny clips of sound that you will play many times, and are often triggered by some event in your game, such as a character jumping or a button push.

To play a sound effect you simply need to emit an event at the end of an update or scene draw and Indigo will do the rest, e.g.:

Outcome(updateModel).addGlobalEvents(PlaySound(AssetName("twang!"), Volume(0.5)))

or

SceneUpdateFragment.empty.addGlobalEvents(PlaySound(AssetName("bounce"), Volume.Max))

Background Music

Background music must be added as part of your scene description, as follows:

SceneUpdateFragment(mySceneNodes)
  .withAudio(
    SceneAudio(
      SceneAudioSource(
        BindingKey("My bg music"),
        PlaybackPattern.SingleTrackLoop(Track(AssetName("music")))
      )
    )
  )

A SceneAudio can describe up to three music channels at once, called SceneAudioSources. A SceneAudioSource specifics a BindingKey to keep track of what is being played and it's progression state, and a playback pattern which at the moment can only be either PlaybackPattern.SingleTrackLoop or Silent. SingleTrackLoop takes a Track which is very similar to the PlaySound type above, taking an AssetName to tell it what to play, and optionally a Volume.

← AnimationDepth & Layers →
  • Audio formats
  • Sound effects
  • Background Music
Indigo
Getting Started
Setup & Configuration Guide"Hello, Indigo!" TutorialLinks to examplesProject templates
Community
DiscordGitHub DiscussonsTwitter
Sponsor us!
GitHub SponsorsPatreon
Copyright © 2021 Purple Kingdom Games Limited