public void execute(int globalTime) { if (!ap.isPlaying()) { int playAt = globalTime - timeStamp; ap.play(playAt); println("gTime is " + globalTime + " delTime is " + playAt); } }
/** Resumes the song. Used when there is user input */ public void resumeSong() { if (fadeEnter) { song.play(); setGainShift(0); fadeEnter = false; } ourPause = false; }
public void start() { song.play(); // FOR STARTING FROM LAST TEN SECONDS // int t = song.length() - 5000; // song.play(t); // song.setGain(0); ourPause = false; }
SplashScreen(PApplet p) { parent = p; splash1 = loadImage("spaceFury01.png"); splash2 = loadImage("spaceFury02.png"); splash3 = loadImage("spaceFury03.png"); playbutton = loadImage("playbutton.png"); playbutton2 = loadImage("playbutton2.png"); highscorebutton = loadImage("highscore.png"); highscorebutton2 = loadImage("highscore2.png"); settingbutton = loadImage("setting.png"); settingbutton2 = loadImage("setting2.png"); quitbutton = loadImage("quit.png"); quitbutton2 = loadImage("quit2.png"); backbutton = loadImage("back.png"); backbutton2 = loadImage("back2.png"); // control images moverl = parent.loadImage("moverightleft.png"); spaceShoot = parent.loadImage("spaceShoot.png"); pauseimg = parent.loadImage("pauseimg.png"); buttonR = parent.loadImage("buttonR.png"); buttonM = parent.loadImage("buttonM.png"); buttonQ = parent.loadImage("buttonQ.png"); // headers controlsline = parent.loadImage("controlsline.png"); bulletsline = parent.loadImage("bulletsline.png"); difficultyline = parent.loadImage("difficultyline.png"); // firebullet bullet1 = parent.loadImage("fireball1.png"); bullet2 = parent.loadImage("fireball2.png"); bullet3 = parent.loadImage("fireball3.png"); bullet4 = parent.loadImage("fireball4.png"); // waterbullet waterbullet1 = parent.loadImage("waterbullet1.png"); waterbullet2 = parent.loadImage("waterbullet2.png"); waterbullet3 = parent.loadImage("waterbullet3.png"); waterbullet4 = parent.loadImage("waterbullet4.png"); // difficulty image rollover easy = parent.loadImage("easy.png"); easy2 = parent.loadImage("easy2.png"); medium = parent.loadImage("medium.png"); medium2 = parent.loadImage("medium2.png"); hard = parent.loadImage("hard.png"); hard2 = parent.loadImage("hard2.png"); // highscore animation images topShooters = parent.loadImage("topShooters.png"); topShooters2 = parent.loadImage("topShooters2.png"); topShooters3 = parent.loadImage("topShooters3.png"); topShooters4 = parent.loadImage("topShooters4.png"); topShooters5 = parent.loadImage("topShooters5.png"); topShooters6 = parent.loadImage("topShooters6.png"); scoreList.add(0); scoreList.add(0); scoreList.add(0); minim = new Minim(this); menuMusic = minim.loadFile("menuMusic.mp3", 2048); menuMusic.play(); }