Commit 6992da5e authored by Nicholas Bindela's avatar Nicholas Bindela
Browse files

End of Day Tuesday, Nicks changes

parent b8d28022
......@@ -43,11 +43,13 @@ public class MainGame extends BasicGameState {
private SpriteSheet xeonSheet = null;
private Animation playerAnimation;
Music mainMusic;
ArrayList<Image> backgrounds = new ArrayList<Image>();
ListIterator<Image> changeBackground;
ArrayList<Music> songs = new ArrayList<Music>();
ListIterator<Music> playList;
Music mainMusic;
private float startY = (float) (HEIGHT - char_Height);
private float startX = WIDTH / 6;
......@@ -139,7 +141,15 @@ public class MainGame extends BasicGameState {
fireImage = new Image("Images/Fireball_Vertical.png");
fireImage = fireImage.getScaledCopy(50, 100);
mainMusic = new Music("Music/SonicTheme.ogg");
Music sonic = new Music("Music/SonicTheme.ogg");
Music gerudo = new Music("Music/GerudoValley.ogg");
songs.add(sonic);
songs.add(gerudo);
mainMusic = songs.get(0);
playList = songs.listIterator();
laser = new Laser();
}
......@@ -171,13 +181,20 @@ public class MainGame extends BasicGameState {
}
pointCounter += 1;
if ((pointCounter % 50000 == 0) && changeBackground.hasNext()) {
background = changeBackground.next();
}
else if (!changeBackground.hasNext()) {
changeBackground = backgrounds.listIterator();
if ((pointCounter % 10000 == 0)) {
if (changeBackground.hasNext()) {
background = changeBackground.next();
}
else if (!changeBackground.hasNext()) {
changeBackground = backgrounds.listIterator();
}
if (playList.hasNext()) {
mainMusic = playList.next();
}
else {
playList = songs.listIterator();
}
}
}
public void render(GameContainer container, StateBasedGame sbg, Graphics g) throws SlickException {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment