v0.8.1: added a slight delay to checked cell vfx based on distance
This commit is contained in:
parent
4a302a6079
commit
985b20ebff
|
@ -1719,7 +1719,7 @@ public class Hero extends Char {
|
|||
if (fieldOfView[p] && p != pos) {
|
||||
|
||||
if (intentional) {
|
||||
sprite.parent.addToBack( new CheckedCell( p ) );
|
||||
sprite.parent.addToBack(new CheckedCell(p, pos));
|
||||
}
|
||||
|
||||
if (Dungeon.level.secret[p]){
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.effects;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
||||
import com.watabou.gltextures.TextureCache;
|
||||
import com.watabou.noosa.Game;
|
||||
|
@ -29,6 +30,7 @@ import com.watabou.noosa.Image;
|
|||
public class CheckedCell extends Image {
|
||||
|
||||
private float alpha;
|
||||
private float delay;
|
||||
|
||||
public CheckedCell( int pos ) {
|
||||
super( TextureCache.createSolid( 0xFF55AAFF ) );
|
||||
|
@ -42,9 +44,18 @@ public class CheckedCell extends Image {
|
|||
alpha = 0.8f;
|
||||
}
|
||||
|
||||
public CheckedCell( int pos, int visSource ) {
|
||||
this( pos );
|
||||
delay = (Dungeon.level.trueDistance(pos, visSource)-1f);
|
||||
//steadily accelerates as distance increases
|
||||
if (delay > 0) delay = (float)Math.pow(delay, 0.75f)/10f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if ((alpha -= Game.elapsed) > 0) {
|
||||
if ((delay -= Game.elapsed) > 0){
|
||||
alpha( 0 );
|
||||
} else if ((alpha -= Game.elapsed) > 0) {
|
||||
alpha( alpha );
|
||||
scale.set( DungeonTilemap.SIZE * alpha );
|
||||
} else {
|
||||
|
|
|
@ -62,7 +62,7 @@ public class StoneOfClairvoyance extends Runestone {
|
|||
left = Math.max(0, left);
|
||||
for (curr = left + y * Dungeon.level.width(); curr <= right + y * Dungeon.level.width(); curr++){
|
||||
|
||||
curUser.sprite.parent.addToBack( new CheckedCell( curr ) );
|
||||
curUser.sprite.parent.addToBack( new CheckedCell( curr, cell ) );
|
||||
Dungeon.level.mapped[curr] = true;
|
||||
|
||||
if (Dungeon.level.secret[curr]) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user