You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
912 B
52 lines
912 B
11 years ago
|
package mightypork.rogue.screens.game;
|
||
11 years ago
|
|
||
11 years ago
|
|
||
11 years ago
|
import java.util.Random;
|
||
|
|
||
11 years ago
|
import mightypork.gamecore.app.AppAccess;
|
||
11 years ago
|
import mightypork.gamecore.gui.screens.LayeredScreen;
|
||
11 years ago
|
import mightypork.gamecore.input.KeyStroke;
|
||
|
import mightypork.gamecore.input.Keys;
|
||
11 years ago
|
import mightypork.rogue.world.WorldProvider;
|
||
11 years ago
|
|
||
|
|
||
|
public class ScreenGame extends LayeredScreen {
|
||
11 years ago
|
|
||
11 years ago
|
|
||
11 years ago
|
private Random rand = new Random();
|
||
|
|
||
|
|
||
11 years ago
|
public ScreenGame(AppAccess app)
|
||
|
{
|
||
11 years ago
|
super(app);
|
||
11 years ago
|
|
||
11 years ago
|
addLayer(new HudLayer(this));
|
||
|
addLayer(new WorldLayer(this));
|
||
11 years ago
|
|
||
|
bindKey(new KeyStroke(Keys.N), new Runnable() {
|
||
|
|
||
|
@Override
|
||
|
public void run()
|
||
|
{
|
||
|
WorldProvider.get().createWorld(rand .nextLong());
|
||
|
}
|
||
|
});
|
||
11 years ago
|
}
|
||
11 years ago
|
|
||
|
|
||
11 years ago
|
@Override
|
||
11 years ago
|
protected void onScreenEnter()
|
||
11 years ago
|
{
|
||
11 years ago
|
super.onScreenEnter();
|
||
|
WorldProvider.get().setListening(true);
|
||
11 years ago
|
}
|
||
|
|
||
11 years ago
|
|
||
11 years ago
|
@Override
|
||
|
protected void onScreenLeave()
|
||
|
{
|
||
|
super.onScreenLeave();
|
||
|
WorldProvider.get().setListening(false);
|
||
|
}
|
||
11 years ago
|
}
|