本文整理汇总了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));
}
示例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();
}