added title screen
This commit is contained in:
@@ -64,8 +64,8 @@ public class GamePanel extends JPanel implements Runnable {
|
||||
public void setupGame() {
|
||||
assetSetter.setObject();
|
||||
assetSetter.setNPC();
|
||||
playMusic(0); //Play main theme
|
||||
gameState = GameState.PLAY;
|
||||
//playMusic(0); //Play main theme
|
||||
gameState = GameState.TITLE;
|
||||
}
|
||||
|
||||
public void startGameThread() {
|
||||
@@ -121,7 +121,13 @@ public class GamePanel extends JPanel implements Runnable {
|
||||
long drawStart = 0;
|
||||
drawStart = System.nanoTime();
|
||||
|
||||
// COMPONENTS
|
||||
// TITLE SCREEN
|
||||
if(gameState == GameState.TITLE) {
|
||||
ui.draw(graphics2d);
|
||||
return;
|
||||
}
|
||||
|
||||
// GAME
|
||||
tileM.draw(graphics2d);
|
||||
for (SuperObject superObject : obj) if (superObject != null) superObject.draw(graphics2d, this);
|
||||
for(Entity npc : npc) if(npc != null) npc.draw(graphics2d);
|
||||
|
||||
Reference in New Issue
Block a user