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


Java Animation.setPingPong方法代码示例

本文整理汇总了Java中org.newdawn.slick.Animation.setPingPong方法的典型用法代码示例。如果您正苦于以下问题:Java Animation.setPingPong方法的具体用法?Java Animation.setPingPong怎么用?Java Animation.setPingPong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.newdawn.slick.Animation的用法示例。


在下文中一共展示了Animation.setPingPong方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.newdawn.slick.Animation; //导入方法依赖的package包/类
/**
 * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
 */
public void init(GameContainer container) throws SlickException {
	this.container = container;
	
	SpriteSheet sheet = new SpriteSheet("testdata/homeranim.png", 36, 65);
	animation = new Animation();
	for (int i=0;i<8;i++) {
		animation.addFrame(sheet.getSprite(i,0), 150);
	}
	limited = new Animation();
	for (int i=0;i<8;i++) {
		limited.addFrame(sheet.getSprite(i,0), 150);
	}
	limited.stopAt(7);
	manual = new Animation(false);
	for (int i=0;i<8;i++) {
		manual.addFrame(sheet.getSprite(i,0), 150);
	}
	pingPong = new Animation(sheet, 0,0,7,0,true,150,true);
	pingPong.setPingPong(true);
	container.getGraphics().setBackground(new Color(0.4f,0.6f,0.6f));
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:25,代码来源:AnimationTest.java

示例2: Player

import org.newdawn.slick.Animation; //导入方法依赖的package包/类
public Player(Vector2f pos) {
	super(pos);
	oxygenConsumptionPerSecond = (int) ConfigManager.playerOxygenConsumption;
	this.gbtype = GameBodyType.PLAYER;
	this.setMaxHealth(20);
	this.setHealth(20);
	this.accFactor = ConfigManager.playerAcc;
	halfSize.set(0.4f, 0.4f);
	try {
		headSprites = new SpriteSheet("assets/textures/animperso.png",256,256);
		headAnimation = new Animation(headSprites, 600);
		headAnimation.setPingPong(true);
		bodySprites = new SpriteSheet("assets/textures/playerBody.png",256,256);
		featherSprites = new SpriteSheet("assets/textures/feather.png",256,256);
		featherAnimation = new Animation(featherSprites, 50);
		featherAnimation.setPingPong(true);
	} catch (SlickException e) {
		e.printStackTrace();
	}
			
	inventory = new Inventory(5,this);
	actionZone = new ActionZone(actionRange, position.x, position.y);
	actionZone.init();
}
 
开发者ID:Mathgoat,项目名称:square-loot,代码行数:25,代码来源:Player.java


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