User prompt
coconut shadow should not move with coconut. I just needs to appear in the 350 Y position below the coconut.
Code edit (1 edits merged)
Please save this source code
User prompt
coconut shadow should spawn in y = 350
User prompt
coconut shadow shoud spawn under every coconut in the same height that the hero shadow is
User prompt
coconut shadow should spawn when coconut is 500 pixels from the bottom of the screen
User prompt
create an asset for coconut shadow
User prompt
coconut shado wil spawn nin the same height as the hero shadow
User prompt
create coconut shade
User prompt
Fix Bug: 'TypeError: LK.effects.createExplosion is not a function' in this line: 'LK.effects.createExplosion(coconut.x, coconut.y, 10, 0xFFFF00, 300);' Line Number: 87
User prompt
add particle effect when cocconuts are destroyed
User prompt
add cocconut explosion effect when they are destroyed
User prompt
destroy coconuts when they are 200 pixels from the bottom of the screen
User prompt
when coconut reaches 350 pixels before bottom of screen it has to be destroyed.
User prompt
move player shadow 50 pixels down
User prompt
move player shadow 50 pixels down
User prompt
move player shadow 100 pixels down
User prompt
move player shadow under the hero image
User prompt
add shadow under hero
User prompt
move score text inside container 20 pixels down
User prompt
move score 20 pixels down
User prompt
add shade to score text
Code edit (1 edits merged)
Please save this source code
User prompt
change score font to 8-bit, cartoon font
User prompt
change score font to square 8 bit font
User prompt
change score font to be more gamer
var Background = Container.expand(function () { var self = Container.call(this); var backgroundGraphics = self.createAsset('background', 'Background Graphics', 0.5, 0.5); backgroundGraphics.x = 1024; backgroundGraphics.y = 1366; }); var ScoreBackground = Container.expand(function () { var self = Container.call(this); var scoreBgGraphics = self.createAsset('scoreBg', 'Score Background Graphics', 0.5, 0); scoreBgGraphics.x = 1024; scoreBgGraphics.y = 0; }); var Coconut = Container.expand(function () { var self = Container.call(this); var coconutGraphics = self.createAsset('coconut', 'Coconut Graphics', .5, .5); self.setSpeed = function (score) { self.speed = 5 + Math.floor(score / 10); }; self.move = function () { self.y += self.speed; }; }); var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.createAsset('player', 'Player Graphics', .5, .5); var playerLeftGraphics = self.createAsset('playerLeft', 'Player Left Graphics', .5, .5); playerLeftGraphics.visible = false; self.targetX = self.x; self.targetY = self.y; self.moveSpeed = 20; self.move = function (x, y) { self.targetX = x; self.targetY = y; }; self.update = function () { var dx = self.targetX - self.x; var dy = self.targetY - self.y; var distanceX = Math.abs(dx); var distanceY = Math.abs(dy); playerGraphics.visible = dx >= 0; playerLeftGraphics.visible = dx < 0; if (distanceX > self.moveSpeed) { var newX = self.x + dx / distanceX * self.moveSpeed; self.x = Math.max(0, Math.min(2048 - playerGraphics.width, newX)); } else if (distanceX > 0) { self.x = self.targetX; } }; }); var Game = Container.expand(function () { var self = Container.call(this); var background = self.addChild(new Background()); var score = 0; var scoreBackground = self.addChild(new ScoreBackground()); var scoreTxt = new Text2(score.toString(), { size: 150, fill: "#ffffff", font: "'Press Start 2P', monospace", dropShadow: true, dropShadowColor: '#000000', dropShadowBlur: 4, dropShadowAngle: Math.PI / 6, dropShadowDistance: 6 }); scoreTxt.anchor.set(.5, 0); scoreTxt.y = 20; LK.gui.topCenter.addChild(scoreTxt); var player = self.addChild(new Player()); player.x = 2048 / 2; player.y = 2732 - 350; var coconuts = []; stage.on('down', function (obj) { var event = obj.event; var pos = event.getLocalPosition(self); player.move(pos.x, pos.y); }); LK.on('tick', function () { player.update(); for (var a = coconuts.length - 1; a >= 0; a--) { var coconut = coconuts[a]; coconut.move(); if (coconut.y > 2732) { score++; scoreTxt.setText(score.toString()); coconut.destroy(); coconuts.splice(a, 1); } } if (LK.ticks % 60 == 0) { var newCoconut = new Coconut(); newCoconut.setSpeed(score); newCoconut.x = Math.random() * 2048; newCoconut.y = 0; coconuts.push(newCoconut); self.addChild(newCoconut); } for (var b = 0; b < coconuts.length; b++) { if (player.intersects(coconuts[b])) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } } }); });
===================================================================
--- original.js
+++ change.js
@@ -7,9 +7,9 @@
var ScoreBackground = Container.expand(function () {
var self = Container.call(this);
var scoreBgGraphics = self.createAsset('scoreBg', 'Score Background Graphics', 0.5, 0);
scoreBgGraphics.x = 1024;
- scoreBgGraphics.y = 20;
+ scoreBgGraphics.y = 0;
});
var Coconut = Container.expand(function () {
var self = Container.call(this);
var coconutGraphics = self.createAsset('coconut', 'Coconut Graphics', .5, .5);
@@ -62,8 +62,9 @@
dropShadowAngle: Math.PI / 6,
dropShadowDistance: 6
});
scoreTxt.anchor.set(.5, 0);
+ scoreTxt.y = 20;
LK.gui.topCenter.addChild(scoreTxt);
var player = self.addChild(new Player());
player.x = 2048 / 2;
player.y = 2732 - 350;
8-bit. Cartoon. Guy the beach. Full body. Looking up. Sunglasses. Worried. In game asset. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
delete inpain selection
pixelart cartoon beach schene. just the beach and a big palm tree. no background.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixelart cartoon beach background for a mobile screen.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.