Package org.newdawn.slick

Examples of org.newdawn.slick.Sound


  private void loadSound(Element element) throws SlickException {
    checkRequiredAttributes(element, "key", "file");
    String key = element.getAttribute("key");
    String file = element.getAttribute("file");
    Log.debug(formatLoadMsg("sound", key, file));
    ResourceManager.addSound(key, new Sound(baseDir + file));
  }
View Full Code Here


    public static Music getMusic(String name) throws SlickException {
        return new Music(getResourceFolder() + "music" + FILE_SEPARATOR + name + ".ogg");
    }

    public static Sound getSound(String name) throws SlickException {
        return new Sound(getResourceFolder() + "sounds" + FILE_SEPARATOR + name + ".wav");
    }
View Full Code Here

    ) throws SlickException {
   
    this._stateBasedGame = game;
    this._container = container;
   
    Sound buttonSound = new Sound(VisualBurglar.PATH_SOUNDS + SUBPATH_CLICK_SOUND);
   
    // buttons:
    this._buttonListener = new StickyListener();
   
    this.createExitButton(container, buttonSound);
View Full Code Here

    throws SlickException {
   
    this._stateBasedGame = game;
    this._container = container;
   
    Sound buttonSound = new Sound(VisualBurglar.PATH_SOUNDS + SUBPATH_CLICK_SOUND);
   
    // buttons:
    this._buttonListener = new StickyListener();
   
    this.createLevelButtons(container, buttonSound);
View Full Code Here

    // create the buttons if not yet initiated:
    // set up the buttons:
    this._buttonListener = new StickyListener();
   
    this._buttonSound =
      new Sound(VisualBurglar.PATH_SOUNDS + SUBPATH_CLICK_SOUND);
    // buttons:
     
    this._buttonPanel.init(container, this._buttonListener, this._buttonSound);
   
    this._contextMenu.init(container, this._buttonListener, this._buttonSound);
View Full Code Here

  public static final String BUILDING_START = BASE + "building_start";
  public static final String BUILDING_END = BASE + "building_end";
 
  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

    deerDyin = new Animation(new SpriteSheet(new Image("img/deerdyn.gif",false,Image.FILTER_NEAREST), 32, 32),100);
    deerDyin.setLooping(false);
    bearDyin  = new Animation(new SpriteSheet(new Image("img/beardyn.gif",false,Image.FILTER_NEAREST), 32, 32),100);
    bearDyin.setLooping(false);

    plStep = new Sound("snd/plStep.wav");
    deerStp = new Sound("snd/deerwlk.wav");
    bearStp= new Sound("snd/berWalk.wav");
    swing = new Sound("snd/swing.wav");
    thrw = new Sound("snd/seartrw.wav");
    spHit = new Sound("snd/sphit.wav");
    maceHit =  new Sound("snd/smash.wav");
    dmgs = new Sound("snd/dmgs.wav");
    deerAgr = new Sound("snd/elkroar.wav");
    deerAtk = new Sound("snd/deeratk.wav");
    deerDmg = new Sound("snd/deerdmgd.wav");
    deerDin = new Sound("snd/deerdyin.wav");
    bearAgr = new Sound("snd/broar1.wav");
    bearAtk = new Sound("snd/bata.wav");
    bearDmg = new Sound("snd/bdmgd.wav");
    bearDin = new Sound("snd/bded.wav");

    lyhye = new Sound("snd/lyhye.ogg");
    intro = new Sound("snd/oleni.ogg");
    outro = new Sound("snd/gover.ogg");

    polka = new Music("snd/msc/SpazzmaticaPolka.ogg");

    isIntrd1 = false;
    xScale = gc.getWidth()/320f;
View Full Code Here

    File[] files = dir.listFiles(filter);
    HashMap<String, Sound> sfxMap = new HashMap<String, Sound>();
    for (File elem : files) {
      try {
        String name = elem.getName().replaceFirst(".ogg", "");
        sfxMap.put(name, new Sound(elem.getAbsolutePath()));
      } catch (SlickException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
View Full Code Here

 
  public Sound sound() {
    if (fSound != null) return fSound;
    if (fFile == null) return null;
    try {
      fSound = new Sound(new ByteArrayInputStream(fFile.data()));
    } catch (SlickException e) {
      e.printStackTrace();
    }
    return fSound;
  }
View Full Code Here

    } catch (SlickException e) {
      e.printStackTrace();
    }
   
    try {
      fMenuMusic = new Sound("lib/menu.ogg");
      fMenuMusic.loop();
    } catch (SlickException e) {
      // TODO Log error
    }
  }
View Full Code Here

TOP

Related Classes of org.newdawn.slick.Sound

Copyright © 2018 www.massapicom. 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.