Skip to content
Permalink
Browse files

Last minute changes, including showing the score, changing how secret

mode works, and fixed some bugs
  • Loading branch information
jdm13003 committed Apr 27, 2016
1 parent f0529ac commit a0be16413ef147dc325b64f987de7c2c2225b574
Showing with 37 additions and 12 deletions.
  1. +4 −1 src/main/Game.java
  2. +2 −11 src/main/MouseInput.java
  3. +31 −0 src/main/ShowScore.java
@@ -75,6 +75,7 @@
private Controller c;
private Skins tp;
private Menu menu;
private ShowScore showscore;
public static int numberOfPlayers = 2;
public static boolean padraicmode = false;

@@ -107,6 +108,7 @@ public void init()
tp = new Skins(this);
c = new Controller(tp, this);
menu = new Menu();
showscore = new ShowScore(this);

if(numberOfPlayers == 2){
p2 = new Player2(300, 300, tp, this, c);
@@ -286,7 +288,8 @@ private void render(){
level = 0;
}else if(State == STATE.END){
g.drawImage(gameOver,0,0, null);
if(delay == 10000){
showscore.render(g);
if(delay == 1000){
State = STATE.MENU;
}
delay++;
@@ -31,13 +31,11 @@ public void mousePressed(MouseEvent e) {
if(mx >= 265 && mx <= 535 && my >= 225 && my <= 275)
{
Game.numberOfPlayers = 1;
Game.padraicmode = false;
Game.State = Game.STATE.GAME;
}
else if(mx >= 285 && mx <= 515 && my >= 325 && my <= 375)
{
Game.numberOfPlayers = 2;
Game.padraicmode = false;
Game.State = Game.STATE.GAME;
}
else if(mx >= 365 && mx <= 435 && my >= 425 && my <= 475)
@@ -46,16 +44,9 @@ else if(mx >= 365 && mx <= 435 && my >= 425 && my <= 475)
}
else if(mx >= 610 && mx <= 650 && my >= 540 && my <= 580)
{
Game.numberOfPlayers = 1;
Game.padraicmode = true;
Game.State = Game.STATE.GAME;
}
else if(mx >= 0 && mx <= 40 && my >= 0 && my <= 40)
{
Game.numberOfPlayers = 2;
Game.padraicmode = true;
Game.State = Game.STATE.GAME;
Game.padraicmode = !Game.padraicmode;
}

}

}
@@ -0,0 +1,31 @@
package main;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Font;

public class ShowScore {
private Game game;
private int shift = 0;

public ShowScore(Game game){
this.game = game;
}
public void render(Graphics g){
Font title_font = new Font("comic sans ms", Font.BOLD, 100);
g.setFont(title_font);
g.setColor(Color.white);
if(game.getScore()>= 100){
shift = -50;
}
if(game.getScore() >= 1000){
shift = -75;
}
if(game.getScore() >= 10000){
shift = -100;
}
g.drawString("SCORE: " + Integer.toString(game.getScore()), 145+shift, 450);


}

}

0 comments on commit a0be164

Please sign in to comment.
You can’t perform that action at this time.