v0.5.0b: improved the game's handling of very short item sprites
This commit is contained in:
parent
2cb9a4245b
commit
762bddccc0
Binary file not shown.
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
@ -67,7 +67,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
|
|||
private static final float FLASH_INTERVAL = 0.05f;
|
||||
|
||||
//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
|
||||
//offset is the number of pixels the shadow is moved down or up (handy for some animations)
|
||||
|
|
|
@ -62,7 +62,7 @@ public class ItemSprite extends MovieClip {
|
|||
private float dropInterval;
|
||||
|
||||
//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
|
||||
//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 ) {
|
||||
if (this.emitter != null) this.emitter.killAndErase();
|
||||
emitter = null;
|
||||
frame( ItemSpriteSheet.film.get( image ) );
|
||||
frame( image );
|
||||
if ((this.glowing = glowing) == null) {
|
||||
resetColor();
|
||||
}
|
||||
|
@ -202,6 +202,12 @@ public class ItemSprite extends MovieClip {
|
|||
|
||||
public void frame( int 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
|
||||
|
|
|
@ -308,7 +308,7 @@ public class ItemSpriteSheet {
|
|||
assignItemRect(ARTIFACT_CHALICE1, 12, 15);
|
||||
assignItemRect(ARTIFACT_CHALICE2, 12, 15);
|
||||
assignItemRect(ARTIFACT_CHALICE3, 12, 15);
|
||||
assignItemRect(ARTIFACT_SANDALS, 16, 5 );
|
||||
assignItemRect(ARTIFACT_SANDALS, 16, 6 );
|
||||
assignItemRect(ARTIFACT_SHOES, 16, 6 );
|
||||
assignItemRect(ARTIFACT_BOOTS, 16, 9 );
|
||||
assignItemRect(ARTIFACT_GREAVES, 16, 14);
|
||||
|
|
Loading…
Reference in New Issue
Block a user