Skip to content

Commit

Permalink
Better entity marker
Browse files Browse the repository at this point in the history
  • Loading branch information
deepnight committed Apr 22, 2024
1 parent 32fabac commit 687633a
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/game/Fx.hx
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,22 @@ class Fx extends GameChildProcess {
public inline function allocMain_normal(id,x,y) return pool.alloc(main_normal, Assets.tiles.getTileRandom(id), x, y);


public inline function markerEntity(e:Entity, c:Col=Pink, short=false) {
public inline function markerEntity(e:Entity, c:Col=Pink, sec=3.0) {
#if debug
if( e!=null && e.isAlive() )
markerCase(e.cx, e.cy, short?0.03:3, c);
if( e!=null && e.isAlive() ) {
var p = allocMain_add(D.tiles.fxCircle15, e.attachX, e.attachY);
p.setCenterRatio(e.pivotX, e.pivotY);
p.scaleTo(e.wid, e.hei);
p.setFadeS(1, 0, 0.06);
p.colorize(c);
p.lifeS = sec;

var p = allocMain_add(D.tiles.pixel, e.attachX, e.attachY);
p.setFadeS(1, 0, 0.06);
p.colorize(c);
p.setScale(2);
p.lifeS = sec;
}
#end
}

Expand Down

0 comments on commit 687633a

Please sign in to comment.