Finished bacis collioion handling, and bacis game life cycle funtions.

the came can be started, pasused, restarted, won, and lost

Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-04-02 13:36:30 -04:00
parent faeb1b790c
commit 88b8853c31
8 changed files with 265 additions and 78 deletions

View File

@@ -36,6 +36,7 @@ public class Display extends JPanel {
private static final long serialVersionUID = -9105117186423881937L;
private AsteroidGame mGame;
private Container mContainer;
private String mText;
/**
* Creates a new Dispay
@@ -57,6 +58,11 @@ public class Display extends JPanel {
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
if(mText != null){
g.setColor(Color.ORANGE);
g.drawString(mText, this.getHeight() /2 , this.getWidth() / 2);
}
/*
* Move & Draw the world's objects
@@ -72,4 +78,8 @@ public class Display extends JPanel {
((Drawable) item).draw(g);
}
}
public void setDisplayText(String string) {
mText = string;
}
}