Added Backgrounds

This commit is contained in:
Sagi Dayan 2016-03-20 22:37:17 +02:00
parent 40657262a7
commit 992fdb997d
5 changed files with 4 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

View file

@ -10,6 +10,7 @@ import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.Vector;
import javax.swing.JLabel;
@ -65,7 +66,9 @@ public abstract class Level extends Scene {
keys = new HashMap<>();
yAxisStartingAnimation = new int[]{height + (5*GameEngine.PLAYER_HEIGHT) , height - (4*GameEngine.PLAYER_HEIGHT) , height - (GameEngine.PLAYER_HEIGHT + 15)};
startingAnimationIndex = 0;
bg = new Background(0,0,width,height, 1, "L1-BG.jpg", 0,1000, 4760);
Random r = new Random();
int bgIndex = r.nextInt(5) + 1;
bg = new Background(0,0,width,height, 1, "L"+bgIndex+"-BG.jpg", 0,1000, 4760);
this.numOfPlayers = numOfPlayers;
this.title = stageTitle;
this.stageTitle = new JLabel(this.title);