Package org.newdawn.slick

Examples of org.newdawn.slick.Sound.play()


  protected void added(Entity e) {
    SoundFile soundFile = soundMapper.get(e);

    try {
      Sound sound = new Sound(soundFile.getSoundFile());
      sound.play(1, 0.3f);
    } catch (SlickException e1) {
      e1.printStackTrace();
    }
  }
View Full Code Here


  }

  public void playSound(String name) {
    Sound s = getSound(name);
    if (s != null)
      s.play();
  }

  public void playSound(String name, float x, float y) {
    playSound(name, x, 1, y);
  }
View Full Code Here

 
  public static void playSound(String key) {
    Sound s;
    try {
      s = new Sound(key + EXT);
      s.play();
    } catch (SlickException e) {
      System.out.println("Could not play sound : " + key + EXT);
      e.printStackTrace();
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.