本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.Dungeon.deleteGame方法的典型用法代码示例。如果您正苦于以下问题:Java Dungeon.deleteGame方法的具体用法?Java Dungeon.deleteGame怎么用?Java Dungeon.deleteGame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.shatteredpixel.shatteredpixeldungeon.Dungeon
的用法示例。
在下文中一共展示了Dungeon.deleteGame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reallyDie
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //导入方法依赖的package包/类
public static void reallyDie( Object cause ) {
int length = Level.LENGTH;
int[] map = Dungeon.level.map;
boolean[] visited = Dungeon.level.visited;
boolean[] discoverable = Level.discoverable;
for (int i=0; i < length; i++) {
int terr = map[i];
if (discoverable[i]) {
visited[i] = true;
if ((Terrain.flags[terr] & Terrain.SECRET) != 0) {
Level.set( i, Terrain.discover( terr ) );
GameScene.updateMap( i );
}
}
}
Bones.leave();
Dungeon.observe();
Dungeon.hero.belongings.identify();
GameScene.gameOver();
if (cause instanceof Hero.Doom) {
((Hero.Doom)cause).onDeath();
}
Dungeon.deleteGame( Dungeon.hero.heroClass, true );
}
示例2: create
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; //导入方法依赖的package包/类
@Override
public void create() {
super.create();
BitmapTextMultiline text = null;
if (!noText) {
text = createMultiline( TXT, 8 );
text.maxWidth = WIDTH;
text.measure();
add( text );
}
amulet = new Image( Assets.AMULET );
add( amulet );
RedButton btnExit = new RedButton( TXT_EXIT ) {
@Override
protected void onClick() {
Dungeon.win( ResultDescriptions.WIN );
Dungeon.deleteGame( Dungeon.hero.heroClass, true );
Game.switchScene( noText ? TitleScene.class : RankingsScene.class );
}
};
btnExit.setSize( WIDTH, BTN_HEIGHT );
add( btnExit );
RedButton btnStay = new RedButton( TXT_STAY ) {
@Override
protected void onClick() {
onBackPressed();
}
};
btnStay.setSize( WIDTH, BTN_HEIGHT );
add( btnStay );
float height;
if (noText) {
height = amulet.height + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height();
amulet.x = align( (Camera.main.width - amulet.width) / 2 );
amulet.y = align( (Camera.main.height - height) / 2 );
btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, amulet.y + amulet.height + LARGE_GAP );
btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
} else {
height = amulet.height + LARGE_GAP + text.height() + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height();
amulet.x = align( (Camera.main.width - amulet.width) / 2 );
amulet.y = align( (Camera.main.height - height) / 2 );
text.x = align( (Camera.main.width - text.width()) / 2 );
text.y = amulet.y + amulet.height + LARGE_GAP;
btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.y + text.height() + LARGE_GAP );
btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
}
new Flare( 8, 48 ).color( 0xFFDDBB, true ).show( amulet, 0 ).angularSpeed = +30;
fadeIn();
}