blob: 924728229be0353baa6aadf91c2d17acd49d9250 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.fourisland.fourpuzzle.gamestate;
import com.fourisland.fourpuzzle.*;
import com.fourisland.fourpuzzle.gamestate.mapview.MapViewGameState;
import com.fourisland.fourpuzzle.transition.SquareTransition;
import com.fourisland.fourpuzzle.transition.TransitionDirection;
import com.fourisland.fourpuzzle.util.ObjectLoader;
import java.awt.Graphics2D;
import java.awt.event.KeyEvent;
/**
*
* @author hatkirby
*/
public class TitleScreenGameState implements GameState {
public void initalize()
{
Audio.playMusic(Database.getMusic("Title"));
}
public void deinitalize()
{
Audio.stopMusic();
}
public void processInput()
{
if (Game.getKey().getKeyCode() == KeyEvent.VK_ENTER)
{
Game.setSaveFile(new SaveFile());
new Thread(new Runnable() {
public void run() {
try {
Display.transition(new SquareTransition(TransitionDirection.Out));
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
Game.setGameState(new MapViewGameState("TestMap", 1, 2));
try {
Display.transition(new SquareTransition(TransitionDirection.In));
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
}
}).start();
}
}
public void doGameCycle()
{
// Do nothing, yet
}
public void render(Graphics2D g)
{
g.drawImage(ObjectLoader.getImage("Picture", "Title"), 0, 0, null);
}
}
|