Skip to content

Commit

Permalink
Rendering tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ricochet1k committed Apr 6, 2017
1 parent 39b496f commit e4516c0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/scripts/objects/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export default class Extension extends GameObject {

g.lineStyle(0, 0, 0);
g.beginFill(0xffff00);
g.drawCircle(S(5), S(5), (S(4) - 2) * obj.energy / obj.energyCapacity);
let e = (S(4) - 2) * Math.sqrt(obj.energy / obj.energyCapacity);
if (e > 0) e = Math.max(1, e);
g.drawCircle(S(5), S(5), e);
g.endFill();
}
}
4 changes: 3 additions & 1 deletion src/scripts/objects/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export default class Source extends GameObject {
g.drawCircle(S(5), S(5), S(5));

g.beginFill(0xffff00);
g.drawCircle(S(5), S(5), S(5) * Math.ceil(obj.energy / obj.energyCapacity));
let e = S(5) * Math.sqrt(obj.energy / obj.energyCapacity);
if (e > 0) e = Math.max(1, e);
g.drawCircle(S(5), S(5), e);
g.endFill();
}
}
4 changes: 3 additions & 1 deletion src/scripts/objects/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export default class Spawn extends GameObject {

g.lineStyle(0, 0, 0);
g.beginFill(0xffff00);
g.drawCircle(S(5), S(5), S(5) * obj.energy / obj.energyCapacity);
let e = (S(5) - 2) * Math.sqrt(obj.energy / obj.energyCapacity);
if (e > 0) e = Math.max(1, e);
g.drawCircle(S(5), S(5), e);
g.endFill();
}
}
2 changes: 1 addition & 1 deletion src/scripts/skins/original/creep.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class CreepSkin {
g.lineStyle(0, 0, 0);
g.beginFill(0xffff00);
let e = S(2.5) * Math.sqrt(obj.energy / obj.energyCapacity);
if (obj.energy > 0) e = Math.max(1, e);
if (e > 0) e = Math.max(1, e);
g.drawCircle(m, m, e);
g.endFill();

Expand Down

0 comments on commit e4516c0

Please sign in to comment.