User prompt
Make fly biggwr
User prompt
Make more particles
User prompt
Particles still dont move.
User prompt
Toxic particles doesnt move. Also they should slowly disappear.
User prompt
Add green nuclear toxic particles from toxic flies
User prompt
Make fly trajectory transparent
User prompt
Make toxic fly spawn only at screen edges
User prompt
Cancel the FlyTrajectory line update, just use stretched rectangle
User prompt
Fix Bug: 'trajectoryGraphics.lineStyle is not a function' in this line: 'trajectoryGraphics.lineStyle(4, 0xFFBD01, 1);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: trajectoryGraphics.beginFill is not a function' in this line: 'trajectoryGraphics.lineStyle(4, 0xFFBD01, 1);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: trajectoryGraphics.lineStyle is not a function' in this line: 'trajectoryGraphics.setStrokeStyle(4, 0xFFBD01, 1);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: trajectoryGraphics.lineStyle is not a function' in this line: 'trajectoryGraphics.lineStyle(4, 0xFFBD01, 1);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: trajectoryGraphics.lineStyle is not a function' in this line: 'trajectoryGraphics.moveTo(0, 0);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: trajectoryGraphics.beginFill is not a function' in this line: 'trajectoryGraphics.lineStyle(2, 0xFFFFFF, 1);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: trajectoryGraphics.lineStyle is not a function' in this line: 'trajectoryGraphics.graphics.lineStyle(2, 0xFFFFFF, 1);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: trajectoryGraphics.lineStyle is not a function' in this line: 'trajectoryGraphics.lineStyle(2, 0xFFFFFF, 1);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: trajectoryGraphics.lineStyle is not a function' in this line: 'trajectoryGraphics.setStrokeStyle(2, 0xFFFFFF, 1);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: trajectoryGraphics.lineStyle is not a function' in this line: 'trajectoryGraphics.lineStyle(2, 0xFFFFFF, 1);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: trajectoryGraphics.beginFill is not a function' in this line: 'trajectoryGraphics.beginFill(0xFFFFFF);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: Graphics is not a constructor' in this line: 'var trajectoryGraphics = self.createAsset('trajectory', 'Trajectory', 0.5, 0.5);' Line Number: 3
User prompt
Fix Bug: 'Timeout.tick error: trajectoryGraphics.lineStyle is not a function' in this line: 'trajectoryGraphics.moveTo(0, 0);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: Graphics is not a constructor' in this line: 'var trajectoryGraphics = LK.getAsset('trajectory', 'Trajectory', 0.5, 0.5);' Line Number: 3
User prompt
Fix Bug: 'Timeout.tick error: Graphics is not a constructor' in this line: 'var trajectoryGraphics = new Graphics();' Line Number: 3
User prompt
Fly's trajectory must be a line!
User prompt
Make flies more predictable, within one second before spawning, there should be fat line showing fly's trajectory
var ToxicParticle = Container.expand(function () { var self = Container.call(this); var toxicParticleGraphics = self.createAsset('toxicParticle', 'Toxic Particle', .5, .5); toxicParticleGraphics.scale.set(0.5); self.move = function () { self.x += self.vx; self.y += self.vy; self.alpha -= 0.01; if (self.alpha <= 0) { self.destroy(); } }; LK.on('tick', function () { self.move(); }); }); var FlyTrajectory = Container.expand(function () { var self = Container.call(this); var trajectoryGraphics = self.addChild(LK.getAsset('trajectory', 'Trajectory', 0.5, 0.5)); trajectoryGraphics.scale.set(2); trajectoryGraphics.alpha = 0.5; self.setTrajectory = function (startX, startY, endX, endY) { var dx = endX - startX; var dy = endY - startY; var distance = Math.sqrt(dx * dx + dy * dy); var angle = Math.atan2(dy, dx); trajectoryGraphics.width = distance; trajectoryGraphics.rotation = angle; self.x = startX; self.y = startY; }; }); var ToxicFly = Container.expand(function () { var self = Container.call(this); var toxicFlyGraphics = self.createAsset('toxicFly', 'Toxic Fly', .5, .5); toxicFlyGraphics.scale.set(3); self.move = function () { self.x += self.vx; self.y += self.vy; for (var i = 0; i < 5; i++) { if (Math.random() < 0.2) { var toxicParticle = new ToxicParticle(); toxicParticle.x = self.x; toxicParticle.y = self.y; toxicParticle.vx = (Math.random() - 0.5) * 2; toxicParticle.vy = (Math.random() - 0.5) * 2; self.parent.addChild(toxicParticle); } } }; }); var Frog = Container.expand(function () { var self = Container.call(this); self.vx = 0; self.vy = 0; self.gravity = 0.5; var frogGraphics = self.createAsset('frog', 'Frog character', .5, .5); frogGraphics.scale.set(2); self.jump = function (targetX, targetY) { var dx = targetX - self.x; var dy = targetY - self.y; var angle = Math.atan2(dy, dx); self.vx = Math.cos(angle) * 20; self.vy = Math.sin(angle) * 20; }; self.dodge = function (targetX, targetY) { var dx = targetX - self.x; var dy = targetY - self.y; var angle = Math.atan2(dy, dx); self.vx = Math.cos(angle) * 10; self.vy = Math.sin(angle) * 10; }; }); var LilyPad = Container.expand(function () { var self = Container.call(this); var lilyPadGraphics = self.createAsset('lilyPad', 'Lily pad', .5, .5); lilyPadGraphics.scale.set(3, 1); self.move = function () {}; self.checkCollision = function (otherLilyPad) { var dx = self.x - otherLilyPad.x; var dy = self.y - otherLilyPad.y; var distance = Math.sqrt(dx * dx + dy * dy); return distance < self.width / 2 + otherLilyPad.width / 2; }; }); var Danger = Container.expand(function () { var self = Container.call(this); var dangerGraphics = self.createAsset('danger', 'Danger', .5, .5); self.move = function () {}; }); var Game = Container.expand(function () { var self = Container.call(this); var background = self.createAsset('background', 'Game Background', 0, 0); background.width = 2048; background.height = 2732; var frog = self.addChild(new Frog()); var lilyPads = []; for (var i = 0; i < 5; i++) { var lilyPad = new LilyPad(); do { lilyPad.x = Math.random() * 2048; lilyPad.y = Math.random() * 2732 / 2 + 2732 / 2; } while (lilyPads.some(function (otherLilyPad) { return lilyPad.checkCollision(otherLilyPad); })); lilyPads.push(lilyPad); self.addChild(lilyPad); } var dangers = []; var toxicFlies = []; frog.x = 2048 / 2; frog.y = 2732 / 2; var spawnToxicFly = function () { var edge = Math.floor(Math.random() * 4); var startX = edge == 0 || edge == 2 ? Math.random() * 2048 : edge == 1 ? 0 : 2048; var startY = edge == 0 || edge == 2 ? edge == 0 ? 0 : 2732 : Math.random() * 2732; var dx = frog.x - startX; var dy = frog.y - startY; var angle = Math.atan2(dy, dx); var trajectory = new FlyTrajectory(); trajectory.setTrajectory(startX, startY, frog.x, frog.y); self.addChild(trajectory); LK.setTimeout(function () { var toxicFly = new ToxicFly(); toxicFly.x = startX; toxicFly.y = startY; toxicFly.vx = Math.cos(angle) * 30; toxicFly.vy = Math.sin(angle) * 30; toxicFlies.push(toxicFly); self.addChild(toxicFly); trajectory.destroy(); }, 1000); }; LK.setInterval(spawnToxicFly, 3000); LK.on('tick', function () { frog.x += frog.vx; frog.y += frog.vy; frog.vy += frog.gravity; for (var i = 0; i < lilyPads.length; i++) { if (frog.intersects(lilyPads[i])) { frog.vy = -10; } } for (var i = 0; i < toxicFlies.length; i++) { if (frog.intersects(toxicFlies[i])) { LK.showGameOver(); } } for (var i = 0; i < lilyPads.length; i++) { lilyPads[i].move(); if (lilyPads[i].x < -50) { lilyPads[i].destroy(); lilyPads.splice(i, 1); } } for (var i = 0; i < toxicFlies.length; i++) { toxicFlies[i].move(frog.x, frog.y); if (toxicFlies[i].x < -50 || toxicFlies[i].x > 2048 || toxicFlies[i].y < -50 || toxicFlies[i].y > 2732) { toxicFlies[i].destroy(); toxicFlies.splice(i, 1); } } }); stage.on('down', function (obj) { var event = obj.event; var pos = event.getLocalPosition(self); frog.jump(pos.x, pos.y); }); });
===================================================================
--- original.js
+++ change.js
@@ -32,9 +32,9 @@
});
var ToxicFly = Container.expand(function () {
var self = Container.call(this);
var toxicFlyGraphics = self.createAsset('toxicFly', 'Toxic Fly', .5, .5);
- toxicFlyGraphics.scale.set(2);
+ toxicFlyGraphics.scale.set(3);
self.move = function () {
self.x += self.vx;
self.y += self.vy;
for (var i = 0; i < 5; i++) {
Cartoon lilypad Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Cartoon tileable swamp background, dark Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Cartoon. Green nuclear toxic fly Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
cartoon cute fat toad Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.