HUD improved
@ -76,6 +76,7 @@ public class GamePlayManager {
|
||||
System.exit(-1);
|
||||
}
|
||||
player = new Player(level);
|
||||
player.score = 1000000;
|
||||
gameObjectManager.getPlayerObject().setGamePlayManager(this);
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ public class LevelManager {
|
||||
private List<String> loadBackgroundImages(){
|
||||
List<String> images = new ArrayList<>();
|
||||
for(int i=1;i<=BACKGROUND_IMAGE_COUNT;i++){
|
||||
images.add("backgrounds/background_"+i+".png");
|
||||
images.add("background_"+i+".png");
|
||||
}
|
||||
return images;
|
||||
}
|
||||
|
@ -137,9 +137,7 @@ public abstract class Bubble extends CollidingGameObject implements MovingGameOb
|
||||
*
|
||||
* @return the score to add
|
||||
*/
|
||||
public int getBurstScore(){
|
||||
return (int)(size*1000);
|
||||
}
|
||||
public abstract int getBurstScore();
|
||||
|
||||
/**
|
||||
* Get the size of the bubble.
|
||||
|
@ -20,7 +20,7 @@ public class Background extends GameObject {
|
||||
this.position.setTo(0,0);
|
||||
size = 1;
|
||||
rotation = 0;
|
||||
backgroundImage = "backgrounds/background_1.png";
|
||||
backgroundImage = "background_1.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,11 +20,11 @@ public class LevelLabel extends GameObject {
|
||||
*/
|
||||
public LevelLabel(GameView gameView){
|
||||
super(gameView);
|
||||
size = 3;
|
||||
width = 101;
|
||||
size = 1;
|
||||
width = 109;
|
||||
height = 8;
|
||||
level = 1;
|
||||
getPosition().setTo(GameView.WIDTH/2.0 - (width/2.0),GameView.HEIGHT-height-60);
|
||||
getPosition().setTo(GameView.WIDTH/2.0 - width,GameView.HEIGHT-height-60);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,7 +24,7 @@ public class LevelProgressBar extends GameObject {
|
||||
width = 101;
|
||||
height = 8;
|
||||
levelProgress = 0;
|
||||
getPosition().setTo(GameView.WIDTH/2.0 - (width/2.0),GameView.HEIGHT-(height*size));
|
||||
getPosition().setTo(GameView.WIDTH/2.0 - width,GameView.HEIGHT-(height*size));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -8,17 +8,7 @@ import de.thdeg.greiner.superpangworld.graphics.base.GameObject;
|
||||
*/
|
||||
public class LivesLabel extends GameObject {
|
||||
|
||||
private final static String ICON =
|
||||
" RR RR \n"+
|
||||
" RRRR RRRR \n"+
|
||||
"RRRRRRRRRRR\n"+
|
||||
"RRRRRRRRRRR\n"+
|
||||
" RRRRRRRRR \n"+
|
||||
" RRRRRRR \n"+
|
||||
" RRRRR \n"+
|
||||
" RRR \n"+
|
||||
" R \n";
|
||||
|
||||
/** Lives count */
|
||||
private int lifeCount;
|
||||
|
||||
/**
|
||||
@ -29,19 +19,19 @@ public class LivesLabel extends GameObject {
|
||||
public LivesLabel(GameView gameView) {
|
||||
super(gameView);
|
||||
rotation = 0;
|
||||
size = 5;
|
||||
width = 12;
|
||||
height = 12;
|
||||
size = 2;
|
||||
width = (int) size * 12;
|
||||
height = (int) size * 12;
|
||||
|
||||
this.lifeCount = 0;
|
||||
|
||||
position.setTo(0,GameView.HEIGHT-50);
|
||||
position.setTo(10,GameView.HEIGHT - height - 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addToCanvas() {
|
||||
for(int i=0;i<lifeCount;i++){
|
||||
gameView.addBlockImageToCanvas(ICON,position.x + (i*size*width),position.y,size,rotation);
|
||||
gameView.addImageToCanvas("livesIcon.png",position.x + (i*size*width),position.y,size,rotation);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,16 +21,16 @@ public class ScoreLabel extends GameObject {
|
||||
public ScoreLabel(GameView gameView) {
|
||||
super(gameView);
|
||||
score = 0;
|
||||
size = 50;
|
||||
width = 100;
|
||||
height = 8;
|
||||
size = 1;
|
||||
width = (int) size * 100;
|
||||
height = (int) size * 8;
|
||||
|
||||
position.setTo(GameView.WIDTH/2 - (width/2) -250,GameView.HEIGHT-height-60);
|
||||
position.setTo(0,GameView.HEIGHT-height-60);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addToCanvas() {
|
||||
gameView.addTextToCanvas(Integer.toString(score),getPosition().x,getPosition().y,40, Color.YELLOW,0);
|
||||
gameView.addTextToCanvas(Integer.toString(score),getPosition().x,getPosition().y,30, Color.YELLOW,0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -66,6 +66,23 @@ public class HexagonalBubble extends Bubble {
|
||||
rotation = (rotation + 1) % 360;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBurstScore() {
|
||||
// 1 0.5 0.25 0.125
|
||||
switch((int)(size*1000)){
|
||||
case 1000:
|
||||
return 200;
|
||||
case 500:
|
||||
return 400;
|
||||
case 250:
|
||||
return 600;
|
||||
case 125:
|
||||
return 1200;
|
||||
default:
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
gameView.playSound("burst.wav",false);
|
||||
|
@ -131,6 +131,22 @@ public class RoundBubble extends Bubble {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBurstScore() {
|
||||
switch((int)(size*100)){
|
||||
case 1000:
|
||||
return 100;
|
||||
case 500:
|
||||
return 200;
|
||||
case 250:
|
||||
return 300;
|
||||
case 125:
|
||||
return 400;
|
||||
default:
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus() {
|
||||
|
||||
|
@ -115,6 +115,11 @@ public class SpecialBubble extends Bubble {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBurstScore() {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus() {}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 305 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
BIN
SuperPangWorld/src/resources/livesIcon.png
Normal file
After Width: | Height: | Size: 225 B |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 305 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
BIN
out/production/SuperPangWorld/resources/livesIcon.png
Normal file
After Width: | Height: | Size: 225 B |