本文整理汇总了Java中org.newdawn.slick.state.transition.FadeOutTransition类的典型用法代码示例。如果您正苦于以下问题:Java FadeOutTransition类的具体用法?Java FadeOutTransition怎么用?Java FadeOutTransition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FadeOutTransition类属于org.newdawn.slick.state.transition包,在下文中一共展示了FadeOutTransition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: keyReleased
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
/**
* @see org.newdawn.slick.state.BasicGameState#keyReleased(int, char)
*/
public void keyReleased(int key, char c) {
if (key == Input.KEY_2) {
GameState target = game.getState(TestState2.ID);
final long start = System.currentTimeMillis();
CrossStateTransition t = new CrossStateTransition(target) {
public boolean isComplete() {
return (System.currentTimeMillis() - start) > 2000;
}
public void init(GameState firstState, GameState secondState) {
}
};
game.enterState(TestState2.ID, t, new EmptyTransition());
}
if (key == Input.KEY_3) {
game.enterState(TestState3.ID, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
}
}
示例2: keyReleased
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
/**
* @see org.newdawn.slick.state.BasicGameState#keyReleased(int, char)
*/
public void keyReleased(int key, char c) {
if (key == Input.KEY_DOWN) {
selected++;
if (selected >= options.length) {
selected = 0;
}
}
if (key == Input.KEY_UP) {
selected--;
if (selected < 0) {
selected = options.length - 1;
}
}
if (key == Input.KEY_1) {
game.enterState(TestState1.ID, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
}
if (key == Input.KEY_2) {
game.enterState(TestState2.ID, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
}
}
示例3: update
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
@Override
public void update(GameContainer gc, StateBasedGame sbg, int i) throws SlickException {
if (shouldToggleFullscreen) {
shouldToggleFullscreen = false;
boolean fs = !gc.isFullscreen();
AppGameContainer agc = (AppGameContainer)gc;
agc.setDisplayMode(fs ? agc.getScreenWidth() : Application.DISPLAY_WIDTH,
fs ? agc.getScreenHeight() : Application.DISPLAY_HEIGHT, fs);
}
if (gc.getInput().isKeyPressed(Input.KEY_ENTER)) {
click.play(1.0f, CLICK_VOLUME);
mainMenu.fade(1000, 0.0f, true);
sbg.enterState(Application.GAME, new FadeOutTransition(Color.black, 1000), new EmptyTransition());
}
if (gc.getInput().isKeyPressed(Input.KEY_C)) {
sbg.enterState(Application.CREDITS);
}
}
示例4: update
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
@Override
public void update(GameContainer gc, StateBasedGame game, int delta) throws SlickException {
if(gameStart.inBounds(Globals.mouse.getPosition().x, Globals.mouse.getPosition().y)) {
gameStart.mouseEnter();
if(Globals.mouse.isMouseDown()) {
Globals.resetEntityNum();
Globals.resetInputs();
game.enterState(GameState.ID, new FadeOutTransition(), new FadeInTransition());
}
} else gameStart.mouseExit();
if(credits.inBounds(Globals.mouse.getPosition().x, Globals.mouse.getPosition().y)) credits.mouseEnter();
else credits.mouseExit();
if(exit.inBounds(Globals.mouse.getPosition().x, Globals.mouse.getPosition().y)) {
exit.mouseEnter();
if(Globals.mouse.isMouseDown()) gc.exit();
}
else exit.mouseExit();
MusicPlayer.getInstance().update();
}
示例5: backToMainMenu
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
private void backToMainMenu(StateBasedGame sbg) {
pressedEscape = false;
caseMonsterAnimation = 2;
pressedEnter = false;
monsterPicking = true;
songPicking = false;
p1Picking = true;
p2Picking = false;
for (Music music : musicSongChoices) {
if (music.playing()) {
music.stop();
}
}
MainMenuState.resumeMusic();
sbg.enterState(BeatBitBeatMain.getMainMenu(), new FadeOutTransition(), new FadeInTransition());
}
示例6: update
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
@Override
public void update(GameContainer gc, StateBasedGame sbg, int i) throws SlickException {
Input input = gc.getInput();
xMouse = input.getMouseX();
yMouse = input.getMouseY();
if (coordHumanP1.getX() != 100){
coordHumanP1.setX(coordHumanP1.getX() - 15);
coordHumanP2.setX(coordHumanP2.getX() + 15);
}
if (pressable){
if (enterPressed){
pressable = false;
enterPressed = false;
sbg.enterState(BeatBitBeatMain.getGameProper(), new FadeOutTransition(), new FadeInTransition());
}
}
//
}
示例7: update
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
@Override
public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException {
String ip = "127.0.0.1";
boolean inp = false;
Input input = container.getInput();
if(input.isKeyDown(Input.KEY_1)){
(new Server()).start();
inp = true;
} else if(input.isKeyDown(Input.KEY_2)){
ip = JOptionPane.showInputDialog("Connect to server using ip.");
inp = true;
}
if(inp){
this.game.enterState(Game.ID, new FadeOutTransition(org.newdawn.slick.Color.black), new FadeInTransition(org.newdawn.slick.Color.black));
new InitThread(ip, (Game) game.getState(Game.ID)).start();
}
}
示例8: update
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
public void update(GameContainer container, StateBasedGame game, int delta)
throws SlickException {
super.update(container, game, delta);
if (mResource != null) {
try {
mResource.load();
} catch (IOException e) {
throw new SlickException("Failed to load: " + mResource.getDescription(), e);
}
mResource = null;
}
mRemaining = LoadingList.get().getRemainingResources();
mTotal = LoadingList.get().getTotalResources();
if (LoadingList.get().getRemainingResources() > 0) {
mResource = LoadingList.get().getNext();
} else {
((Music)DatasManager.getInstance().getFile("Music.menu")).loop();
game.enterState(1, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
}
}
示例9: gameoverInput
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
private void gameoverInput(GameContainer gc, StateBasedGame sbg, Input input) throws SlickException {
if(input.isKeyPressed(Input.KEY_RIGHT)){
if(!selection){
selection = true;
}
}else if(input.isKeyPressed(Input.KEY_LEFT)){
if(selection){
selection = false;
}
}else if(input.isKeyPressed(Input.KEY_ENTER)){
if(selection){
status.get(0).setData(false);
sbg.getState(Spacerun.MAINMENUSTATE).init(gc, sbg);
sbg.enterState(Spacerun.MAINMENUSTATE, new FadeOutTransition(), new FadeInTransition());
}else{
sbg.getState(Spacerun.GAMESTATE).init(gc, sbg);
sbg.enterState(Spacerun.GAMESTATE, new FadeOutTransition(), new FadeInTransition());
}
}
}
示例10: update
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
@Override
public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException {
Input input = gc.getInput();
if(input.isKeyPressed(Input.KEY_ESCAPE)){
sbg.getState(Spacerun.MAINMENUSTATE).init(gc, sbg);
sbg.enterState(Spacerun.MAINMENUSTATE, new FadeOutTransition(), new FadeInTransition());
}
if(input.isKeyPressed(Input.KEY_UP)){
menuSelection = true;
}else if(input.isKeyPressed(Input.KEY_DOWN)){
menuSelection = false;
}else if(input.isKeyPressed(Input.KEY_ENTER)){
if(menuSelection){
if((boolean)status.get(1).getData()){
status.get(1).setData(false);
}else{
status.get(1).setData(true);
}
}else{
sbg.getState(Spacerun.MAINMENUSTATE).init(gc, sbg);
sbg.enterState(Spacerun.MAINMENUSTATE, new FadeOutTransition(), new FadeInTransition());
}
}
}
示例11: update
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
@Override
public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException{
Input input = gc.getInput();
if(input.isKeyPressed(Input.KEY_LEFT)){
selection = false;
}else if(input.isKeyPressed(Input.KEY_RIGHT)){
selection = true;
}else if(input.isKeyPressed(Input.KEY_ENTER)){
if(selection){
fHandler.deleteHighscore();
sbg.getState(Spacerun.HIGHSCORESTATE).init(gc, sbg); //we need to update the screen; the easiest way
sbg.enterState(Spacerun.HIGHSCORESTATE, new FadeOutTransition(), new FadeInTransition());
}else{
sbg.getState(Spacerun.MAINMENUSTATE).init(gc, sbg);
sbg.enterState(Spacerun.MAINMENUSTATE, new FadeOutTransition(), new FadeInTransition());
}
}
if(input.isKeyPressed(Input.KEY_ESCAPE)){
sbg.getState(Spacerun.MAINMENUSTATE).init(gc, sbg);
sbg.enterState(Spacerun.MAINMENUSTATE, new FadeOutTransition(), new FadeInTransition());
}
}
示例12: update
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
@Override
public void update(GameContainer container, StateBasedGame game, int delta)
throws SlickException {
if(!loadComplete)
{
if(makeFighter(fileName, currentFighter))
{
if(loadingSecondCharacter)
{
loadComplete = true;
System.out.println("LOAD COMPLETE");
}
else
{
fileName = fighter2;
loadingSecondCharacter = true;
}
}
}
if(loadComplete)
{
//if(flashyThingDone || skipButtonPressed)
game.enterState(Manager.StateIndex.FIGHT.ordinal(), new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
}
}
示例13: keyReleased
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
/**
* @see org.newdawn.slick.state.BasicGameState#keyReleased(int, char)
*/
public void keyReleased(int key, char c) {
if (key == Input.KEY_1) {
game.enterState(TestState1.ID, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
}
if (key == Input.KEY_3) {
game.enterState(TestState3.ID, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
}
}
示例14: proceedToGameProper
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
private void proceedToGameProper(StateBasedGame sbg) {
// stop playing preview of songs
for (int i = 0; i < musicSongChoices.length; i++) {
musicSongChoices[i].stop();
}
GameProperState.setMonsterP1(monsterP1);
GameProperState.setMonsterP2(monsterP2);
// TODO low prio. 3..2..1.. Countdown at GameProperState before music starts
sbg.enterState(BeatBitBeatMain.getVersusPreview(), new FadeOutTransition(), new FadeInTransition());
}
示例15: update
import org.newdawn.slick.state.transition.FadeOutTransition; //导入依赖的package包/类
@Override
public void update(GameContainer gameContainer, StateBasedGame stateBasedGame, int i) throws SlickException {
if (pressedEscape) {
pressedEscape = false;
stateBasedGame.enterState(BeatBitBeatMain.getMainMenu(), new FadeOutTransition(), new FadeInTransition());
}
}