From 52ba8c24418625a62ab75d088ed56549e5f871c3 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 23 Jan 2017 23:45:36 -0500 Subject: [PATCH] v0.5.0: improved alignment for items and characters --- .../shatteredpixeldungeon/sprites/CharSprite.java | 2 +- .../shatteredpixeldungeon/sprites/ItemSprite.java | 10 ++++++---- .../sprites/SpinnerSprite.java | 13 +++++++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java index 036b4cfcb..4a2e4d8ff 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java @@ -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.4f; + protected float perspectiveRaise = 0.375f; //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) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java index 4c0eb394e..7ca4b56a1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java @@ -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.333f; + protected float perspectiveRaise = 0.3125f; //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) @@ -130,13 +130,15 @@ public class ItemSprite extends MovieClip { return new PointF( cell % Dungeon.level.width() * csize + (csize - width()) * 0.5f, - cell / Dungeon.level.width() * csize + (csize - height()) - csize * 0.333f + cell / Dungeon.level.width() * csize + (csize - height()) - csize * perspectiveRaise ); } public void place( int p ) { - if (Dungeon.level != null) - point( worldToCamera( p ) ); + if (Dungeon.level != null) { + point(worldToCamera(p)); + shadowOffset = 0.5f; + } } public void drop() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SpinnerSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SpinnerSprite.java index ebfa40014..42ef69e6b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SpinnerSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SpinnerSprite.java @@ -21,13 +21,16 @@ package com.shatteredpixel.shatteredpixeldungeon.sprites; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.watabou.noosa.TextureFilm; public class SpinnerSprite extends MobSprite { public SpinnerSprite() { super(); - + + perspectiveRaise = 0f; + texture( Assets.SPINNER ); TextureFilm frames = new TextureFilm( texture, 16, 16 ); @@ -46,7 +49,13 @@ public class SpinnerSprite extends MobSprite { play( idle ); } - + + @Override + public void link(Char ch) { + super.link(ch); + renderShadow = false; + } + @Override public int blood() { return 0xFFBFE5B8;