v0.5.0b: improved the game's handling of very short item sprites

This commit is contained in:
Evan Debenham 2017-02-17 19:04:43 -05:00
parent 2cb9a4245b
commit 762bddccc0
4 changed files with 10 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -67,7 +67,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
private static final float FLASH_INTERVAL = 0.05f; private static final float FLASH_INTERVAL = 0.05f;
//the amount the sprite is raised from flat when viewed in a raised perspective //the amount the sprite is raised from flat when viewed in a raised perspective
protected float perspectiveRaise = 0.375f; //6 pixels protected float perspectiveRaise = 6 / 16f; //6 pixels
//the width and height of the shadow are a percentage of sprite size //the width and height of the shadow are a percentage of sprite size
//offset is the number of pixels the shadow is moved down or up (handy for some animations) //offset is the number of pixels the shadow is moved down or up (handy for some animations)

View File

@ -62,7 +62,7 @@ public class ItemSprite extends MovieClip {
private float dropInterval; private float dropInterval;
//the amount the sprite is raised from flat when viewed in a raised perspective //the amount the sprite is raised from flat when viewed in a raised perspective
protected float perspectiveRaise = 0.3125f; //5 pixels protected float perspectiveRaise = 5 / 16f; //5 pixels
//the width and height of the shadow are a percentage of sprite size //the width and height of the shadow are a percentage of sprite size
//offset is the number of pixels the shadow is moved down or up (handy for some animations) //offset is the number of pixels the shadow is moved down or up (handy for some animations)
@ -193,7 +193,7 @@ public class ItemSprite extends MovieClip {
public ItemSprite view( int image, Glowing glowing ) { public ItemSprite view( int image, Glowing glowing ) {
if (this.emitter != null) this.emitter.killAndErase(); if (this.emitter != null) this.emitter.killAndErase();
emitter = null; emitter = null;
frame( ItemSpriteSheet.film.get( image ) ); frame( image );
if ((this.glowing = glowing) == null) { if ((this.glowing = glowing) == null) {
resetColor(); resetColor();
} }
@ -202,6 +202,12 @@ public class ItemSprite extends MovieClip {
public void frame( int image ){ public void frame( int image ){
frame( ItemSpriteSheet.film.get( image )); frame( ItemSpriteSheet.film.get( image ));
float height = ItemSpriteSheet.film.height( image );
//adds extra raise to very short items, so they are visible
if (height < 8f){
perspectiveRaise = (5 + 8 - height) / 16f;
}
} }
@Override @Override

View File

@ -308,7 +308,7 @@ public class ItemSpriteSheet {
assignItemRect(ARTIFACT_CHALICE1, 12, 15); assignItemRect(ARTIFACT_CHALICE1, 12, 15);
assignItemRect(ARTIFACT_CHALICE2, 12, 15); assignItemRect(ARTIFACT_CHALICE2, 12, 15);
assignItemRect(ARTIFACT_CHALICE3, 12, 15); assignItemRect(ARTIFACT_CHALICE3, 12, 15);
assignItemRect(ARTIFACT_SANDALS, 16, 5 ); assignItemRect(ARTIFACT_SANDALS, 16, 6 );
assignItemRect(ARTIFACT_SHOES, 16, 6 ); assignItemRect(ARTIFACT_SHOES, 16, 6 );
assignItemRect(ARTIFACT_BOOTS, 16, 9 ); assignItemRect(ARTIFACT_BOOTS, 16, 9 );
assignItemRect(ARTIFACT_GREAVES, 16, 14); assignItemRect(ARTIFACT_GREAVES, 16, 14);