User prompt
double the size of minimap
User prompt
descrease amount of foes to 100
User prompt
Fix Bug: 'TypeError: Cannot set properties of undefined (setting 'x')' in this line: 'foeDots[i].x = foes[i].x / self.worldWidth * minimap.width;' Line Number: 151
User prompt
make 500 foes on start
User prompt
make joystcik invisible on start
User prompt
make a minimap to show player and foes positions
User prompt
add minimap at left top of the screen
User prompt
zoomout on score increase but keep playerblob size same relativeto screen
User prompt
remove background keep tiles only
User prompt
make background tile size force 2048 x 2048 and cover all world
User prompt
force background tile size
User prompt
MAke background tiling 8x8
User prompt
make background tiling
User prompt
make joystick base semitransparent
User prompt
Update joystickStick position on move from joystickBase center position
User prompt
update joystickStick position on move from joystickBase position
User prompt
remove joystick base position from calculation of joystick stick
User prompt
make joystick stick position not in the topleft of screen but above joystick base
User prompt
make joystick stick appear on the press position
User prompt
make joystick being centered around press position
User prompt
make the joystick stick abobe joystickbase
User prompt
make joystick appear on the sreen position of press
var Blob = Container.expand(function () { var self = Container.call(this); var blobGraphics = self.createAsset('blob', 'Blob Graphics', 0.5, 0.5); self.speed = 5; self.vx = 0; self.vy = 0; self.move = function () { self.x = Math.max(0, Math.min(self.x + self.vx, 16384)); self.y = Math.max(0, Math.min(self.y + self.vy, 16384)); }; self.expand = function () {}; }); var Foe = Container.expand(function () { var self = Container.call(this); var foeGraphics = self.createAsset('foe', 'Foe Graphics', 0.5, 0.5); self.speed = 3; self.move = function () {}; }); var Game = Container.expand(function () { var self = Container.call(this); self.worldWidth = 16384; self.worldHeight = 16384; var background = self.createAsset('background', 'Background', 0, 0); background.width = self.worldWidth; background.height = self.worldHeight; self.addChildAt(background, 0); var blobs = []; var foes = []; var isGameOver = false; var dragNode = null; var playerBlob = self.addChild(new Blob()); playerBlob.x = self.worldWidth / 2; playerBlob.y = self.worldHeight / 2; playerBlob.width = 300; playerBlob.height = 300; blobs.push(playerBlob); for (var i = 0; i < 100; i++) { var foe = self.addChild(new Foe()); foe.x = Math.random() * self.worldWidth; foe.y = Math.random() * self.worldHeight; foes.push(foe); } var joystickBase = LK.gui.createAsset('joystickBase', 'Joystick Base', 0, 0); var joystickStick = LK.gui.createAsset('joystickStick', 'Joystick Stick', 0.5, 0.5); joystickBase.visible = true; joystickStick.visible = false; var score = 0; var scoreTxt = new Text2(score.toString(), { size: 150, fill: '#ffffff' }); scoreTxt.anchor.set(.5, .5); LK.gui.center.addChild(scoreTxt); stage.on('down', function (obj) { var event = obj.event; var pos = event.getLocalPosition(joystickBase.parent); joystickBase.x = pos.x; joystickBase.y = pos.y; joystickBase.visible = true; joystickDrag = true; }); stage.on('up', function (obj) { joystickBase.visible = false; }); var joystickDrag = false; joystickBase.on('down', function (obj) { joystickDrag = true; }); var initialJoystickPos = null; stage.on('down', function (obj) { var event = obj.event; initialJoystickPos = event.getLocalPosition(joystickBase.parent); joystickDrag = true; }); stage.on('move', function (obj) { if (joystickDrag) { var event = obj.event; var pos = event.getLocalPosition(joystickBase.parent); var dx = pos.x - initialJoystickPos.x; var dy = pos.y - initialJoystickPos.y; var distance = Math.sqrt(dx * dx + dy * dy); var angle = Math.atan2(dy, dx); playerBlob.vx = Math.cos(angle) * playerBlob.speed; playerBlob.vy = Math.sin(angle) * playerBlob.speed; joystickStick.x = Math.min(distance, joystickBase.width / 2) * Math.cos(angle); joystickStick.y = Math.min(distance, joystickBase.height / 2) * Math.sin(angle); joystickStick.visible = true; } }); stage.on('up', function (obj) { joystickDrag = false; playerBlob.vx = 0; playerBlob.vy = 0; joystickStick.visible = false; joystickStick.x = 0; joystickStick.y = 0; }); LK.on('tick', function () { for (var i = 0; i < blobs.length; i++) { blobs[i].move(); } for (var i = 0; i < foes.length; i++) { foes[i].move(); } for (var i = 0; i < blobs.length; i++) { for (var j = 0; j < foes.length; j++) { if (blobs[i].intersects(foes[j])) { blobs[i].expand(); foes[j].destroy(); foes.splice(j, 1); score += 1; scoreTxt.setText(score.toString()); } } } if (blobs.length == 0) { isGameOver = true; } if (isGameOver) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } self.x = -Math.min(Math.max(playerBlob.x, 2048 / 2), self.worldWidth - 2048 / 2) + 2048 / 2; self.y = -Math.min(Math.max(playerBlob.y, 2732 / 2), self.worldHeight - 2732 / 2) + 2732 / 2; }); });
===================================================================
--- original.js
+++ change.js
@@ -40,9 +40,9 @@
foe.y = Math.random() * self.worldHeight;
foes.push(foe);
}
var joystickBase = LK.gui.createAsset('joystickBase', 'Joystick Base', 0, 0);
- var joystickStick = joystickBase.createAsset('joystickStick', 'Joystick Stick', 0.5, 0.5);
+ var joystickStick = LK.gui.createAsset('joystickStick', 'Joystick Stick', 0.5, 0.5);
joystickBase.visible = true;
joystickStick.visible = false;
var score = 0;
var scoreTxt = new Text2(score.toString(), {