本文整理匯總了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;
}
}
}