V0.2.0: made missile throw animation 'if statement' dynamic
This commit is contained in:
parent
0510e579b8
commit
d996b16a4a
|
@ -21,6 +21,7 @@ import com.watabou.noosa.tweeners.PosTweener;
|
||||||
import com.watabou.noosa.tweeners.Tweener;
|
import com.watabou.noosa.tweeners.Tweener;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap;
|
import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
import com.watabou.utils.Callback;
|
import com.watabou.utils.Callback;
|
||||||
import com.watabou.utils.PointF;
|
import com.watabou.utils.PointF;
|
||||||
|
|
||||||
|
@ -56,7 +57,8 @@ public class MissileSprite extends ItemSprite implements Tweener.Listener {
|
||||||
PointF d = PointF.diff( dest, point() );
|
PointF d = PointF.diff( dest, point() );
|
||||||
speed.set( d ).normalize().scale( SPEED );
|
speed.set( d ).normalize().scale( SPEED );
|
||||||
|
|
||||||
if (image == 31 || image == 108 || image == 109 || image == 110) {
|
if (image == ItemSpriteSheet.DART || image == ItemSpriteSheet.INCENDIARY_DART
|
||||||
|
|| image == ItemSpriteSheet.CURARE_DART || image == ItemSpriteSheet.JAVELIN) {
|
||||||
angularSpeed = 0;
|
angularSpeed = 0;
|
||||||
angle = 135 - (float)(Math.atan2( d.x, d.y ) / 3.1415926 * 180);
|
angle = 135 - (float)(Math.atan2( d.x, d.y ) / 3.1415926 * 180);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user