User prompt
flip fish icon in the direction they are moving. If fish is moving right, flip fish icon right. if fish moving left, flip fish icon left.
User prompt
Modify urchin expand: urchin expands when layer taps anywhere on screen except on urchin icon
User prompt
Modify urchin expand. Expand player taps anywhere else on the screen.
User prompt
Player drags urchin by pressing down but must tap again to expand urchin
User prompt
Fish spawn off screen and gravitate toward urchin when they get within a certain radius
User prompt
Increase the amount that urgent expands when player presses
User prompt
Fix Bug: 'TypeError: scoreTxt.getText is not a function. (In 'scoreTxt.getText()', 'scoreTxt.getText' is undefined)' in this line: 'scoreTxt.setText(parseInt(scoreTxt.getText()) + 1);' Line Number: 52
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'scoreTxt.text.toString')' in this line: 'scoreTxt.setText(parseInt(scoreTxt.text.toString()) + 1);' Line Number: 52
User prompt
Fix Bug: 'TypeError: parseInt is not a function. (In 'parseInt(scoreTxt.text)', 'parseInt' is undefined)' in this line: 'scoreTxt.setText(parseInt(scoreTxt.text) + 1);' Line Number: 52
User prompt
Display background behind all graphics
User prompt
When player presses down on urchin urchin graphic expands. When player releases urchin returns to original size
User prompt
Urchin has vertical lines that stick out from center across urchin icon
Initial prompt
Aaron the Urchin
var Urchin = Container.expand(function () { var self = Container.call(this); var urchinGraphics = self.createAsset('urchinWithSpikes', 'Urchin character with spikes', .5, .5); self.speed = 5; self.move = function () {}; self.push = function () {}; }); var Fish = Container.expand(function () { var self = Container.call(this); var fishGraphics = self.createAsset('fish', 'Fish character', .5, .5); self.speed = 3; self.move = function (urchinX, urchinY) { var dx = urchinX - this.x; var dy = urchinY - this.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < 500) { var angle = Math.atan2(dy, dx); var moveX = Math.cos(angle) * this.speed; this.x += moveX; this.y += Math.sin(angle) * this.speed; fishGraphics.scale.x = moveX > 0 ? -1 : 1; } }; }); var Game = Container.expand(function () { var self = Container.call(this); LK.stageContainer.setBackgroundColor(0x000000); var urchin = self.addChild(new Urchin()); var fishes = []; var scoreTxt = new Text2('0', { size: 150, fill: "#ffffff" }); LK.gui.topCenter.addChild(scoreTxt); urchin.x = 2048 / 2; urchin.y = 2732 / 2; var dragNode = null; stage.on('down', function (obj) { var event = obj.event; var pos = event.getLocalPosition(self); var distance = Math.sqrt(Math.pow(pos.x - urchin.x, 2) + Math.pow(pos.y - urchin.y, 2)); if (distance > urchin.width / 2) { urchin.scale.set(1.5); } else { dragNode = urchin; } }); function handleMove(obj) { var event = obj.event; var pos = event.getLocalPosition(self); if (dragNode) { dragNode.x = pos.x; dragNode.y = pos.y; } } stage.on('move', handleMove); stage.on('up', function (obj) { dragNode = null; if (urchin.scale.x > 1) urchin.scale.set(1); }); LK.on('tick', function () { urchin.move(); for (var i = 0; i < fishes.length; i++) { fishes[i].move(urchin.x, urchin.y); if (urchin.intersects(fishes[i])) { urchin.push(); fishes[i].destroy(); fishes.splice(i, 1); scoreTxt.setText(parseInt(scoreTxt.text) + 1); } } if (Math.random() < 0.01) { var newFish = new Fish(); var side = Math.floor(Math.random() * 4); switch (side) { case 0: newFish.x = Math.random() * 2048; newFish.y = -100; break; case 1: newFish.x = 2148; newFish.y = Math.random() * 2732; break; case 2: newFish.x = Math.random() * 2048; newFish.y = 2832; break; case 3: newFish.x = -100; newFish.y = Math.random() * 2732; break; } fishes.push(newFish); self.addChild(newFish); } }); });
===================================================================
--- original.js
+++ change.js
@@ -14,10 +14,12 @@
var dy = urchinY - this.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < 500) {
var angle = Math.atan2(dy, dx);
- this.x += Math.cos(angle) * this.speed;
+ var moveX = Math.cos(angle) * this.speed;
+ this.x += moveX;
this.y += Math.sin(angle) * this.speed;
+ fishGraphics.scale.x = moveX > 0 ? -1 : 1;
}
};
});
var Game = Container.expand(function () {
Sea urchin, cartoon, spiny, long spines, grumpy face, no shadow Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Fish, cartoon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
underwater, ocean, anime landscape Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Bubble, opaque, cartoon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A tender morsel of delicious plankton. cartoon, shiny, no background. bright orange and yellow shrimp. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Game start sign. cartoon, shiny, underwater theme. "START GAME". Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
game success graphic, surprised cartoon shiny words, "WOW!". Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.