Class SoundEffect

java.lang.Object
com.shr4pnel.casino.audio.SoundEffect

public class SoundEffect extends Object
A representation of a sound effect, which can be played or cancelled
Since:
0.1.0
See Also:
  • Constructor Details

    • SoundEffect

      public SoundEffect(String path)
      Build a sound effect with default (1) volume
      Parameters:
      path - Path to sound file relative to assets directory
    • SoundEffect

      public SoundEffect(String path, float vol)
      Build a sound effect, with control over the volume
      Parameters:
      path - Path to sound file relative to assets directory
      vol - Volume, from 0-1
  • Method Details

    • play

      public void play()
      Plays the sound effect
    • cancel

      public void cancel()
      Cancels the sound effect