diff --git a/src/scripts/actions.js b/src/scripts/actions.js index 62ba6b8..9e3d3fd 100644 --- a/src/scripts/actions.js +++ b/src/scripts/actions.js @@ -88,8 +88,8 @@ export function say(container, text) { bubble.drawRoundedRect(0, 0, text.width, text.height, 3); bubble.endFill(); - bubble.position.set(S(5) - (text.width / 2), 0); - text.position.set(S(5) - (text.width / 2), 0); + bubble.position.set(S(5) - (text.width / 2), -S(5)); + text.position.set(S(5) - (text.width / 2), -S(5)); container.addChild(bubble); container.addChild(text); diff --git a/src/scripts/skins/original/creep.js b/src/scripts/skins/original/creep.js index bbe33d9..102b567 100644 --- a/src/scripts/skins/original/creep.js +++ b/src/scripts/skins/original/creep.js @@ -37,6 +37,9 @@ export class CreepSkin { bump(this.g, g, obj, a); break; + case 'say': + break; + case 'repair': case 'build': case 'upgradeController': @@ -54,13 +57,16 @@ export class CreepSkin { actionLine(room, k, {x: obj.x, y: obj.y}, a, 0x0000FF); break; + case 'attack': + bump(this.g, g, obj, a) + default: console.log("actionLog", k, a, this); } } - if("say" in obj.actionLog) { - obj.saying = obj.actionLog.saying; + if(obj.actionLog && "say" in obj.actionLog) { + obj.saying = obj.actionLog.say; } if(obj.saying) { say(this.g, obj.saying.message); @@ -99,12 +105,14 @@ export class CreepSkin { g.arc(m, m, pr-pw, +workAL, -workAL, true); g.endFill(); - g.lineStyle(0, 0, 0); - g.beginFill(0xffff00); - let e = S(2.5) * Math.sqrt(obj.energy / obj.energyCapacity); - if (e > 0) e = Math.max(1, e); - g.drawCircle(m, m, e); - g.endFill(); + if(obj.carryCapacity) { + g.lineStyle(0, 0, 0); + g.beginFill(0xffff00); + let e = S(2.5) * Math.sqrt(obj.energy / obj.carryCapacity); + if (e > 0) e = Math.max(1, e); + g.drawCircle(m, m, e); + g.endFill(); + } tweenRotation(TWEEN_DURATION/2, g, this.creep.lastObj, obj); }