Android Open Source - feup-lpoo-android-tower-defense Assets






From Project

Back to project page feup-lpoo-android-tower-defense.

License

The source code is released under:

MIT License

If you think the Android project feup-lpoo-android-tower-defense listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package pt.up.fe.lpoo.towerdefense;
/*  w  w w .ja va2s. c o m*/
import java.io.File;
import java.util.ArrayList;

import android.graphics.Typeface;
import pt.up.fe.lpoo.framework.Image;
import pt.up.fe.lpoo.framework.Music;
import pt.up.fe.lpoo.framework.Sound;

/**
 * This class contains the assets to be used by the game such as images, sounds, musics and typefaces
 * @author Joao Marinheiro
 * @author Luis Cleto
 */
public class Assets {
    
    public static Image menu, splash, menu_box, lifeIcon, coinIcon, infoBarBG, startIcon;
    public static Image tilePath, tileEmptyTower, tileGoal, tileEntrance, selectionOverlay;
    public static Image turretTowerLevel1, turretTowerLevel2, turretProjectile;
    public static Image boulderTower, boulderProjectile;
    public static Image barricade, frozenEffect, freezeTower, poisonTower, poisonEffect, slowEffect, tarPool;
    public static Image cancelIcon, removeIcon, upgradeIcon, repairIcon, buildingOptionsBG;
    
    public static Image ptIcon, enIcon, pirateIcon;
    
    public static Animation slimeMovement;
    public static Animation skullUpMovement,skullDownMovement,skullLeftMovement,skullRightMovement;
    public static Animation golemUpMovement,golemDownMovement,golemLeftMovement,golemRightMovement;
    
    public static Music menuTheme, buildUpTheme, gameOverTheme, victoryTheme, pirateTheme;
    public static Sound buttonClick;
    /** Theme songs for each level stored here */
    public static ArrayList<Music> levelThemes;
    /** Highscores for each level */
  public static ArrayList<Integer> levelScores; 
  /** Typeface used for font drawing */
    public static Typeface tf;
    
    public static final String fontsFolderName = "fonts"+File.separator;
    public static final String musicFolderName = "music"+File.separator;
    public static final String soundsFolderName = "sounds"+File.separator;
    public static final String imagesFolderName = "images"+File.separator;
    
    /**
     * Loads all the Music objects
     * @param game Game object with the Audio interface to be used to load the music
     */
    public static void load(TowerDefenseGame game) {
      levelThemes = new ArrayList<Music>();
      
        menuTheme = game.getAudio().createMusic(musicFolderName+MainMenuScreen.MENU_THEME);
        menuTheme.setLooping(true);
        menuTheme.setVolume(0.85f);
        
        buildUpTheme = game.getAudio().createMusic(musicFolderName+"buildUpTheme.mp3");
        buildUpTheme.setLooping(true);
        buildUpTheme.setVolume(0.85f);
        
        gameOverTheme = game.getAudio().createMusic(musicFolderName+"gameOverTheme.mp3");
        gameOverTheme.setLooping(true);
        gameOverTheme.setVolume(0.85f);
        
        pirateTheme = game.getAudio().createMusic(musicFolderName+"pirateTheme.mp3");
        pirateTheme.setLooping(true);
        pirateTheme.setVolume(0.85f);
        
        victoryTheme = game.getAudio().createMusic(musicFolderName+"victoryTheme.mp3");
        victoryTheme.setLooping(true);
        victoryTheme.setVolume(0.85f);
        
        levelThemes.add(game.getAudio().createMusic(musicFolderName+"levelEasy.mp3"));
        levelThemes.get(0).setLooping(true);
      levelThemes.get(0).setVolume(0.85f);
        for(int i=1; i < TowerDefenseGame.NUM_LEVELS; i++){
          if(i==4){
            levelThemes.add(game.getAudio().createMusic(musicFolderName+"levelMid.mp3"));
            levelThemes.get(i).setLooping(true);
            levelThemes.get(i).setVolume(0.85f);
          }
          else if(i==8){
            levelThemes.add(game.getAudio().createMusic(musicFolderName+"levelHard.mp3"));
            levelThemes.get(i).setLooping(true);
            levelThemes.get(i).setVolume(0.85f);
          }
          else
            levelThemes.add(levelThemes.get(i-1));
        }
    }
    
}




Java Source Code List

pt.up.fe.lpoo.framework.Audio.java
pt.up.fe.lpoo.framework.FileIO.java
pt.up.fe.lpoo.framework.Game.java
pt.up.fe.lpoo.framework.Graphics.java
pt.up.fe.lpoo.framework.Image.java
pt.up.fe.lpoo.framework.Input.java
pt.up.fe.lpoo.framework.Music.java
pt.up.fe.lpoo.framework.Pool.java
pt.up.fe.lpoo.framework.Screen.java
pt.up.fe.lpoo.framework.Sound.java
pt.up.fe.lpoo.framework.implementation.AndroidAudio.java
pt.up.fe.lpoo.framework.implementation.AndroidFastRenderView.java
pt.up.fe.lpoo.framework.implementation.AndroidFileIO.java
pt.up.fe.lpoo.framework.implementation.AndroidGame.java
pt.up.fe.lpoo.framework.implementation.AndroidGraphics.java
pt.up.fe.lpoo.framework.implementation.AndroidImage.java
pt.up.fe.lpoo.framework.implementation.AndroidInput.java
pt.up.fe.lpoo.framework.implementation.AndroidMusic.java
pt.up.fe.lpoo.framework.implementation.AndroidSound.java
pt.up.fe.lpoo.framework.implementation.MultiTouchHandler.java
pt.up.fe.lpoo.framework.implementation.SingleTouchHandler.java
pt.up.fe.lpoo.framework.implementation.TouchHandler.java
pt.up.fe.lpoo.towerdefense.Animation.java
pt.up.fe.lpoo.towerdefense.Assets.java
pt.up.fe.lpoo.towerdefense.BarricadeDefense.java
pt.up.fe.lpoo.towerdefense.BoulderProjectile.java
pt.up.fe.lpoo.towerdefense.BoulderTower.java
pt.up.fe.lpoo.towerdefense.BuildingOption.java
pt.up.fe.lpoo.towerdefense.DefenseObject.java
pt.up.fe.lpoo.towerdefense.DescriptionObject.java
pt.up.fe.lpoo.towerdefense.Enemy.java
pt.up.fe.lpoo.towerdefense.FreezeTower.java
pt.up.fe.lpoo.towerdefense.GameElements.java
pt.up.fe.lpoo.towerdefense.GameObj.java
pt.up.fe.lpoo.towerdefense.Golem.java
pt.up.fe.lpoo.towerdefense.InstructionsScreen.java
pt.up.fe.lpoo.towerdefense.LevelScreen.java
pt.up.fe.lpoo.towerdefense.LevelSelectionScreen.java
pt.up.fe.lpoo.towerdefense.LoadingScreen.java
pt.up.fe.lpoo.towerdefense.MainMenuScreen.java
pt.up.fe.lpoo.towerdefense.Messages.java
pt.up.fe.lpoo.towerdefense.MusicPlayer.java
pt.up.fe.lpoo.towerdefense.PathCluster.java
pt.up.fe.lpoo.towerdefense.PoisonTower.java
pt.up.fe.lpoo.towerdefense.Projectile.java
pt.up.fe.lpoo.towerdefense.Skull.java
pt.up.fe.lpoo.towerdefense.Slime.java
pt.up.fe.lpoo.towerdefense.SplashLoadingScreen.java
pt.up.fe.lpoo.towerdefense.StatusEffect.java
pt.up.fe.lpoo.towerdefense.TarPoolDefense.java
pt.up.fe.lpoo.towerdefense.TextParser.java
pt.up.fe.lpoo.towerdefense.Tile.java
pt.up.fe.lpoo.towerdefense.TowerDefenseGame.java
pt.up.fe.lpoo.towerdefense.TurretProjectile.java
pt.up.fe.lpoo.towerdefense.TurretTower.java
pt.up.fe.lpoo.towerdefense.Wave.java