当前位置: 首页>>代码示例>>Java>>正文


Java EmptyTransition类代码示例

本文整理汇总了Java中org.newdawn.slick.state.transition.EmptyTransition的典型用法代码示例。如果您正苦于以下问题:Java EmptyTransition类的具体用法?Java EmptyTransition怎么用?Java EmptyTransition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EmptyTransition类属于org.newdawn.slick.state.transition包,在下文中一共展示了EmptyTransition类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: keyReleased

import org.newdawn.slick.state.transition.EmptyTransition; //导入依赖的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));
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:25,代码来源:TestState1.java

示例2: update

import org.newdawn.slick.state.transition.EmptyTransition; //导入依赖的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);
    }
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:19,代码来源:MainMenu.java

示例3: click

import org.newdawn.slick.state.transition.EmptyTransition; //导入依赖的package包/类
@Override
public void click(GameContainer container, StateBasedGame game) {
	SoundController.playSound(SoundEffect.MENUHIT);
	BeatmapSetNode node = ((ButtonMenu) game.getState(Opsu.STATE_BUTTONMENU)).getNode();
	((SongMenu) game.getState(Opsu.STATE_SONGMENU)).doStateActionOnLoad(MenuState.BEATMAP, node);
	game.enterState(Opsu.STATE_SONGMENU, new EmptyTransition(), new FadeInTransition());
}
 
开发者ID:itdelatrisu,项目名称:opsu,代码行数:8,代码来源:ButtonMenu.java

示例4: mousePressed

import org.newdawn.slick.state.transition.EmptyTransition; //导入依赖的package包/类
@Override
public void mousePressed(int button, int x, int y) {
	if (gameFinished)
		return;

	// watching replay
	if (isReplay || GameMod.AUTO.isActive()) {
		if (button == Input.MOUSE_MIDDLE_BUTTON)
			return;

		// skip button
		if (skipButton.contains(x, y))
			skipIntro();

		// playback speed button
		else if (playbackSpeed.getButton().contains(x, y)) {
			playbackSpeed = playbackSpeed.next();
			MusicController.setPitch(getCurrentPitch());
		}

		// replay seeking
		else if (Options.isReplaySeekingEnabled() && !GameMod.AUTO.isActive() && musicPositionBarContains(x, y)) {
			SoundController.mute(true);  // mute sounds while seeking
			float pos = (y - musicBarY) / musicBarHeight * beatmap.endTime;
			MusicController.setPosition((int) pos);
			lastTrackPosition = (int) pos;
			isSeeking = true;
		}
		return;
	}

	if (Options.isMouseDisabled())
		return;

	// mouse wheel: pause the game
	if (button == Input.MOUSE_MIDDLE_BUTTON && !Options.isMouseWheelDisabled()) {
		int trackPosition = MusicController.getPosition(true);
		if (pauseTime < 0 && breakTime <= 0 && trackPosition >= beatmap.objects[0].getTime()) {
			pausedMousePosition = new Vec2f(x, y);
			pausePulse = 0f;
		}
		if (MusicController.isPlaying() || isLeadIn())
			pauseTime = trackPosition;
		if (video != null)
			video.pause();
		game.enterState(Opsu.STATE_GAMEPAUSEMENU, new EmptyTransition(), new FadeInTransition());
		return;
	}

	// game keys
	int keys = ReplayFrame.KEY_NONE;
	if (button == Input.MOUSE_LEFT_BUTTON)
		keys = ReplayFrame.KEY_M1;
	else if (button == Input.MOUSE_RIGHT_BUTTON)
		keys = ReplayFrame.KEY_M2;
	if (keys != ReplayFrame.KEY_NONE)
		gameKeyPressed(keys, x, y, MusicController.getPosition(true));
}
 
开发者ID:itdelatrisu,项目名称:opsu,代码行数:59,代码来源:Game.java

示例5: enterState

import org.newdawn.slick.state.transition.EmptyTransition; //导入依赖的package包/类
/**
 * Enter a particular game state with no transition
 * 
 * @param id The ID of the state to enter
 */
public void enterState(int id) {
	enterState(id, new EmptyTransition(), new EmptyTransition());
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:9,代码来源:StateBasedGame.java

示例6: enterState

import org.newdawn.slick.state.transition.EmptyTransition; //导入依赖的package包/类
/**
 * Enter a particular game state with no transition
 * Modification: Saves the last state
 *
 * @param id The ID of the state to enter
 */
public void enterState(int id) {
    enterState(id, new EmptyTransition(), new EmptyTransition());
}
 
开发者ID:joshimoo,项目名称:Gorillaz,代码行数:10,代码来源:StateBasedGame.java


注:本文中的org.newdawn.slick.state.transition.EmptyTransition类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。