本文整理汇总了Java中org.newdawn.slick.GameContainer.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java GameContainer.getHeight方法的具体用法?Java GameContainer.getHeight怎么用?Java GameContainer.getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.newdawn.slick.GameContainer
的用法示例。
在下文中一共展示了GameContainer.getHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import org.newdawn.slick.GameContainer; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.state.transition.Transition#update(org.newdawn.slick.state.StateBasedGame, org.newdawn.slick.GameContainer, int)
*/
public void update(StateBasedGame game, GameContainer container, int delta)
throws SlickException {
offset += delta * 1f;
if (offset > container.getHeight() / 2) {
finish = true;
}
}
示例2: update
import org.newdawn.slick.GameContainer; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.state.transition.Transition#update(org.newdawn.slick.state.StateBasedGame, org.newdawn.slick.GameContainer, int)
*/
public void update(StateBasedGame game, GameContainer container, int delta)
throws SlickException {
if (!init) {
init = true;
xp2 = (container.getWidth()/2)+50;
yp2 = (container.getHeight()/4);
}
if (!moveBackDone) {
if (scale1 > 0.4f) {
scale1 -= delta * 0.002f;
if (scale1 <= 0.4f) {
scale1 = 0.4f;
}
xp1 += delta * 0.3f;
if (xp1 > 50) {
xp1 = 50;
}
yp1 += delta * 0.5f;
if (yp1 > (container.getHeight()/4)) {
yp1 = (container.getHeight()/4);
}
} else {
moveBackDone = true;
}
} else {
pause -= delta;
if (pause > 0) {
return;
}
if (scale2 < 1) {
scale2 += delta * 0.002f;
if (scale2 >= 1) {
scale2 = 1f;
}
xp2 -= delta * 1.5f;
if (xp2 < 0) {
xp2 = 0;
}
yp2 -= delta * 0.5f;
if (yp2 < 0) {
yp2 = 0;
}
} else {
finish = true;
}
}
}