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 );
switch (type) {
case PIXEL_DUNGEON:
icon.frame( icon.texture.uvRect( 0, 0, 128, 70 ) );
icon.frame( icon.texture.uvRect( 0, 0, 132, 90 ) );
break;
case BOSS_SLAIN:
icon.frame( icon.texture.uvRect( 0, 70, 128, 105 ) );
icon.frame( icon.texture.uvRect( 0, 90, 128, 125 ) );
break;
case GAME_OVER:
icon.frame( icon.texture.uvRect( 0, 105, 128, 140 ) );
icon.frame( icon.texture.uvRect( 0, 125, 128, 160 ) );
break;
case SELECT_YOUR_HERO:
icon.frame( icon.texture.uvRect( 0, 140, 128, 161 ) );
icon.frame( icon.texture.uvRect( 0, 160, 128, 181 ) );
break;
case PIXEL_DUNGEON_SIGNS:
icon.frame( icon.texture.uvRect( 0, 161, 128, 231 ) );
icon.frame( icon.texture.uvRect( 133, 0, 255, 90 ) );
break;
}
return icon;

View File

@ -67,6 +67,7 @@ public class Fireball extends Component {
public void emit(Emitter emitter, int index, float x, float y) {
Flame p = (Flame)emitter.recycle( Flame.class );
p.reset();
p.heightLimit(Fireball.this.y - 30);
p.x = x - p.width / 2;
p.y = y - p.height / 2;
}
@ -129,6 +130,7 @@ public class Fireball extends Component {
private static float ACC = -20f;
private float timeLeft;
private float heightLimit;
public Flame() {
@ -144,11 +146,21 @@ public class Fireball extends Component {
timeLeft = LIFESPAN;
speed.set( 0, SPEED );
}
public void heightLimit(float limit){
heightLimit = limit;
}
@Override
public void update() {
super.update();
if (y < heightLimit){
y = heightLimit;
speed.set(Random.Float(-20, 20), 0);
acc.set(0, 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 );
add( title );
float height = title.height +
(ShatteredPixelDungeon.landscape() ? DashboardItem.SIZE : DashboardItem.SIZE * 2);
float topRegion = Math.max(95f, h*0.45f);
title.x = (w - title.width()) / 2;
title.y = (h - height) / 2;
placeTorch(title.x + 18, title.y + 20);
placeTorch(title.x + title.width - 18, title.y + 20);
title.x = (w - title.width()) / 2f;
if (ShatteredPixelDungeon.landscape())
title.y = (topRegion - title.height()) / 2f;
else
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 ) ) {
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);
}
};
signs.x = title.x;
signs.x = title.x + (title.width() - signs.width())/2f;
signs.y = title.y;
add( signs );
@ -124,16 +128,15 @@ public class TitleScene extends PixelScene {
add( btnRankings );
if (ShatteredPixelDungeon.landscape()) {
float y = (h + height) / 2 - DashboardItem.SIZE;
btnRankings .setPos( w / 2 - btnRankings.width(), y );
btnBadges .setPos( w / 2, y );
btnPlay .setPos( btnRankings.left() - btnPlay.width(), y );
btnAbout .setPos( btnBadges.right(), y );
btnRankings .setPos( w / 2 - btnRankings.width(), topRegion );
btnBadges .setPos( w / 2, topRegion );
btnPlay .setPos( btnRankings.left() - btnPlay.width(), topRegion );
btnAbout .setPos( btnBadges.right(), topRegion );
} else {
btnBadges.setPos( w / 2 - btnBadges.width(), (h + height) / 2 - DashboardItem.SIZE );
btnAbout.setPos( w / 2, (h + height) / 2 - DashboardItem.SIZE );
btnPlay.setPos( w / 2 - btnPlay.width(), btnAbout.top() - DashboardItem.SIZE );
btnPlay.setPos( w / 2 - btnPlay.width(), topRegion );
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);

View File

@ -61,14 +61,15 @@ public class WelcomeScene extends PixelScene {
title.brightness(0.6f);
add( title );
float height = title.height +
(ShatteredPixelDungeon.landscape() ? 48 : 96);
float topRegion = Math.max(95f, h*0.45f);
title.x = (w - title.width()) / 2;
title.y = (h - height) / 2;
title.x = (w - title.width()) / 2f;
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);
placeTorch(title.x + title.width - 18, title.y + 20);
align(title);
Image signs = new Image( BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON_SIGNS ) ) {
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);
}
};
signs.x = title.x;
signs.x = title.x + (title.width() - signs.width())/2f;
signs.y = title.y;
add( signs );
@ -140,7 +141,7 @@ public class WelcomeScene extends PixelScene {
}
text.text(message, w-20);
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);
}