• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java EmptyTransition类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BlockDoorAcacia类代码示例发布时间:2022-05-22
下一篇:
Java PitchProcessor类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap