Package engine

Source Code of engine.Resources

package engine;

import java.util.HashMap;
import java.util.Map;

import com.threed.jpct.Texture;
import com.threed.jpct.TextureManager;

public class Resources {
  public static Map<String, String> textures = new HashMap<String, String>();
 
  private static void initTextures(){
    textures.put("SUN", "content/sun.png");
    textures.put("PLAYER", "content/planet_player.png");
    textures.put("ENEMY", "content/planet_enemy.png");
    textures.put("NEUTRAL", "content/planet_neutral.png");
    textures.put("front", "content/skybox.png");
    textures.put("back", "content/skybox.png");
    textures.put("left", "content/skybox.png");
    textures.put("right", "content/skybox.png");
    textures.put("up", "content/skybox.png");
    textures.put("down", "content/skybox.png");
    textures.put("background", "content/background.png");
  }
 
  public static void loadResources(){
    initTextures();
      for(String key : textures.keySet()){
      TextureManager.getInstance().addTexture(key, new Texture(textures.get(key)));
    }
  }
}
TOP

Related Classes of engine.Resources

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.