v0.4.1: updated header graphic

This commit is contained in:
Evan Debenham 2016-07-15 22:09:27 -04:00 committed by Evan Debenham
parent e7e189662a
commit 2b6a71080c
5 changed files with 45 additions and 29 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -37,19 +37,19 @@ public class BannerSprites {
Image icon = new Image( Assets.BANNERS ); Image icon = new Image( Assets.BANNERS );
switch (type) { switch (type) {
case PIXEL_DUNGEON: case PIXEL_DUNGEON:
icon.frame( icon.texture.uvRect( 0, 0, 128, 70 ) ); icon.frame( icon.texture.uvRect( 0, 0, 132, 90 ) );
break; break;
case BOSS_SLAIN: case BOSS_SLAIN:
icon.frame( icon.texture.uvRect( 0, 70, 128, 105 ) ); icon.frame( icon.texture.uvRect( 0, 90, 128, 125 ) );
break; break;
case GAME_OVER: case GAME_OVER:
icon.frame( icon.texture.uvRect( 0, 105, 128, 140 ) ); icon.frame( icon.texture.uvRect( 0, 125, 128, 160 ) );
break; break;
case SELECT_YOUR_HERO: case SELECT_YOUR_HERO:
icon.frame( icon.texture.uvRect( 0, 140, 128, 161 ) ); icon.frame( icon.texture.uvRect( 0, 160, 128, 181 ) );
break; break;
case PIXEL_DUNGEON_SIGNS: case PIXEL_DUNGEON_SIGNS:
icon.frame( icon.texture.uvRect( 0, 161, 128, 231 ) ); icon.frame( icon.texture.uvRect( 133, 0, 255, 90 ) );
break; break;
} }
return icon; return icon;

View File

@ -67,6 +67,7 @@ public class Fireball extends Component {
public void emit(Emitter emitter, int index, float x, float y) { public void emit(Emitter emitter, int index, float x, float y) {
Flame p = (Flame)emitter.recycle( Flame.class ); Flame p = (Flame)emitter.recycle( Flame.class );
p.reset(); p.reset();
p.heightLimit(Fireball.this.y - 30);
p.x = x - p.width / 2; p.x = x - p.width / 2;
p.y = y - p.height / 2; p.y = y - p.height / 2;
} }
@ -129,6 +130,7 @@ public class Fireball extends Component {
private static float ACC = -20f; private static float ACC = -20f;
private float timeLeft; private float timeLeft;
private float heightLimit;
public Flame() { public Flame() {
@ -144,11 +146,21 @@ public class Fireball extends Component {
timeLeft = LIFESPAN; timeLeft = LIFESPAN;
speed.set( 0, SPEED ); speed.set( 0, SPEED );
} }
public void heightLimit(float limit){
heightLimit = limit;
}
@Override @Override
public void update() { public void update() {
super.update(); super.update();
if (y < heightLimit){
y = heightLimit;
speed.set(Random.Float(-20, 20), 0);
acc.set(0, 0);
}
if ((timeLeft -= Game.elapsed) <= 0) { if ((timeLeft -= Game.elapsed) <= 0) {

View File

@ -64,14 +64,18 @@ public class TitleScene extends PixelScene {
Image title = BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON ); Image title = BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON );
add( title ); add( title );
float height = title.height + float topRegion = Math.max(95f, h*0.45f);
(ShatteredPixelDungeon.landscape() ? DashboardItem.SIZE : DashboardItem.SIZE * 2);
title.x = (w - title.width()) / 2; title.x = (w - title.width()) / 2f;
title.y = (h - height) / 2; if (ShatteredPixelDungeon.landscape())
title.y = (topRegion - title.height()) / 2f;
placeTorch(title.x + 18, title.y + 20); else
placeTorch(title.x + title.width - 18, title.y + 20); title.y = 16 + (topRegion - title.height() - 16) / 2f;
align(title);
placeTorch(title.x + 22, title.y + 46);
placeTorch(title.x + title.width - 22, title.y + 46);
Image signs = new Image( BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON_SIGNS ) ) { Image signs = new Image( BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON_SIGNS ) ) {
private float time = 0; private float time = 0;
@ -87,7 +91,7 @@ public class TitleScene extends PixelScene {
GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
} }
}; };
signs.x = title.x; signs.x = title.x + (title.width() - signs.width())/2f;
signs.y = title.y; signs.y = title.y;
add( signs ); add( signs );
@ -124,16 +128,15 @@ public class TitleScene extends PixelScene {
add( btnRankings ); add( btnRankings );
if (ShatteredPixelDungeon.landscape()) { if (ShatteredPixelDungeon.landscape()) {
float y = (h + height) / 2 - DashboardItem.SIZE; btnRankings .setPos( w / 2 - btnRankings.width(), topRegion );
btnRankings .setPos( w / 2 - btnRankings.width(), y ); btnBadges .setPos( w / 2, topRegion );
btnBadges .setPos( w / 2, y ); btnPlay .setPos( btnRankings.left() - btnPlay.width(), topRegion );
btnPlay .setPos( btnRankings.left() - btnPlay.width(), y ); btnAbout .setPos( btnBadges.right(), topRegion );
btnAbout .setPos( btnBadges.right(), y );
} else { } else {
btnBadges.setPos( w / 2 - btnBadges.width(), (h + height) / 2 - DashboardItem.SIZE ); btnPlay.setPos( w / 2 - btnPlay.width(), topRegion );
btnAbout.setPos( w / 2, (h + height) / 2 - DashboardItem.SIZE );
btnPlay.setPos( w / 2 - btnPlay.width(), btnAbout.top() - DashboardItem.SIZE );
btnRankings.setPos( w / 2, btnPlay.top() ); btnRankings.setPos( w / 2, btnPlay.top() );
btnBadges.setPos( w / 2 - btnBadges.width(), btnPlay.top() + DashboardItem.SIZE );
btnAbout.setPos( w / 2, btnBadges.top() );
} }
BitmapText version = new BitmapText( "v " + Game.version + "", pixelFont); BitmapText version = new BitmapText( "v " + Game.version + "", pixelFont);

View File

@ -61,14 +61,15 @@ public class WelcomeScene extends PixelScene {
title.brightness(0.6f); title.brightness(0.6f);
add( title ); add( title );
float height = title.height + float topRegion = Math.max(95f, h*0.45f);
(ShatteredPixelDungeon.landscape() ? 48 : 96);
title.x = (w - title.width()) / 2; title.x = (w - title.width()) / 2f;
title.y = (h - height) / 2; if (ShatteredPixelDungeon.landscape())
title.y = (topRegion - title.height()) / 2f;
else
title.y = 16 + (topRegion - title.height() - 16) / 2f;
placeTorch(title.x + 18, title.y + 20); align(title);
placeTorch(title.x + title.width - 18, title.y + 20);
Image signs = new Image( BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON_SIGNS ) ) { Image signs = new Image( BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON_SIGNS ) ) {
private float time = 0; private float time = 0;
@ -84,7 +85,7 @@ public class WelcomeScene extends PixelScene {
GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
} }
}; };
signs.x = title.x; signs.x = title.x + (title.width() - signs.width())/2f;
signs.y = title.y; signs.y = title.y;
add( signs ); add( signs );
@ -140,7 +141,7 @@ public class WelcomeScene extends PixelScene {
} }
text.text(message, w-20); text.text(message, w-20);
float textSpace = h - title.y - (title.height() - 10) - okay.height() - 2; float textSpace = h - title.y - (title.height() - 10) - okay.height() - 2;
text.setPos(10, title.y+(title.height() - 10) + ((textSpace - text.height()) / 2)); text.setPos((w - text.width()) / 2f, title.y+(title.height() - 10) + ((textSpace - text.height()) / 2));
add(text); add(text);
} }