User prompt
Make normal clouds a little transparent
User prompt
Now normal clouds appear moving from right to left in the background
User prompt
Make it so that birds cannot appear underwater
User prompt
So Victory's message says something like play again for a new difficulty
User prompt
Well done
User prompt
So every time you win the bird appears in a different place and one or two birds may appear
User prompt
I wasn't referring to the corners but a little more in the middle.
User prompt
Let's make objects called birds come out from the corners that will move from one side to the other and if the dolphin touches them, he loses.
User prompt
So the whale jumps shorter than the dolphin
User prompt
Now the whale just goes up the whale should fall after jumping
User prompt
Hey, it's not jumping, it's sinking, so jump, don't sink.
User prompt
So the whale makes a little jump when the dolphin jumps on it
User prompt
That the mar are smaller
User prompt
Las isiste más grandes maldito que las aguas más pequeñas
User prompt
As the smallest sea is much smaller than you made it bigger in the first place
User prompt
So the sea returns to its size
User prompt
So when the dolphin leaves the camera it reappears in the center at the same time as the whale and the sea are erased to give the effect that the camera is following it.
User prompt
So there is sea all over the ground
User prompt
So the dolphin can jump where there is no whale
User prompt
So when the dolphin jumps in a place where the whale is not, it creates a transparent cloud that will disappear moments later.
User prompt
Silly, they are touching the whale and they are very far apart, put it as you like
User prompt
Stop that, I'll go back to the way it was. I don't want them to be separated. I want them to be higher up because that way they touch the ground and the dolphin can jump in the clouds.
User prompt
Let that go, I don't want you to separate them, but to put them higher so they don't touch the ground and the dolphin can jump on them.
User prompt
So the clouds are higher and the dolphin can jump in them
User prompt
Raise them and separate them.
/**** * Classes ****/ // Cloud class to be placed above the whale var Cloud = Container.expand(function () { var self = Container.call(this); var cloudGraphics = self.attachAsset('cloud', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // The cloud stays still in the sky }; }); // Dolphin class to be thrown var Dolphin = Container.expand(function () { var self = Container.call(this); var dolphinGraphics = self.attachAsset('dolphin', { anchorX: 0.5, anchorY: 0.5 }); self.vy = 0; // Vertical velocity self.update = function () { self.y += self.vy; self.vy += 1; // Gravity effect if (self.y > 2732) { // Reset position if it falls below the screen self.y = 2732; self.vy = 0; } // Make the dolphin spin as it jumps self.rotation += 0.1; }; }); // Mar class to be placed on the ground var Mar = Container.expand(function () { var self = Container.call(this); var marGraphics = self.attachAsset('Mar', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // The mar stays still on the ground }; }); //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> // Whale class to support the dolphin var Whale = Container.expand(function () { var self = Container.call(this); var whaleGraphics = self.attachAsset('whale', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // Make the whale follow the dolphin horizontally self.x = dolphin.x; }; self.flatten = function () { // Play a toy sound LK.getSound('toy').play(); }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB // Sky blue background }); /**** * Game Code ****/ // Initialize whale, dolphin and mar var whale = game.addChild(new Whale()); whale.x = 1024; // Center horizontally whale.y = 2500; // Near the bottom var dolphin = game.addChild(new Dolphin()); dolphin.x = whale.x; dolphin.y = whale.y - 100; // Position above the whale // Create 10 Mar instances and distribute them across the ground var mars = []; for (var i = 0; i < 10; i++) { var mar = game.addChild(new Mar()); mar.x = i * 204.8; // Distribute horizontally mar.y = 2732; // At the bottom mar.scaleX = 3; // Make them bigger mar.scaleY = 3; // Make them bigger mars.push(mar); } // Create a tower of 3 Cloud instances over the whale with increased distance between them var clouds = []; for (var i = 0; i < 3; i++) { var cloud = game.addChild(new Cloud()); cloud.x = whale.x; // Align with the whale horizontally cloud.y = whale.y - i * 1500; // Distribute vertically with increased distance clouds.push(cloud); } // Event listener for throwing the dolphin game.down = function (x, y, obj) { if (dolphin.y >= whale.y - 100 && Math.abs(dolphin.x - whale.x) < whale.width / 2) { dolphin.vy = -50; // Increase upward velocity if jumping on the whale LK.getSound('toy').play(); // Play a toy sound } else if (dolphin.y >= whale.y - 100) { dolphin.vy = -20; // Initial upward velocity } }; // Play background music LK.playMusic('Jumping_song'); // Update game state game.update = function () { dolphin.update(); whale.update(); if (dolphin.y <= 0) { // Dolphin reached the top LK.showYouWin(); } };
===================================================================
--- original.js
+++ change.js
@@ -93,9 +93,9 @@
var clouds = [];
for (var i = 0; i < 3; i++) {
var cloud = game.addChild(new Cloud());
cloud.x = whale.x; // Align with the whale horizontally
- cloud.y = whale.y - i * 1200; // Distribute vertically with increased distance
+ cloud.y = whale.y - i * 1500; // Distribute vertically with increased distance
clouds.push(cloud);
}
// Event listener for throwing the dolphin
game.down = function (x, y, obj) {