User prompt
Make sure to check if the seagull is at the top of the screen to show the victory message before ending the game
User prompt
Make a voctory message if the seagull reaches the top of the screen
User prompt
Make twice as many headwinds
User prompt
Remove score
User prompt
Create half as many thermals as headwinds
User prompt
Give each headwind and thermal instance a random speed
User prompt
Make speed boost last for three seconds
User prompt
Thermals give seagull a temporary speed boost
User prompt
Make the seagull lag the mouse curor slightly
User prompt
Remove the seagull's momentum
User prompt
Make the momentum smooth and graceful
User prompt
Give the seagull slight momentum, so that it lags the cursor movement a bit, as though the seagull has mass
User prompt
If the seagull is driven back to the bottom of the screen, the seagull loses
User prompt
There is no score counter
User prompt
Seagull moves slowly toward the top of the screen. If it reaches the top edge, seagull wins.
User prompt
Cursor position only controls left-right position. Seagull always moves forward unless it encounters headwinds
User prompt
Push the seagull back twice as far
User prompt
Headwinds don't kill the seagull. Headwinds push the seagull back toward the bottom of the screen.
User prompt
make headwinds move toward the bottom of the screen.
User prompt
make headwinds move toward the bottom of the screen
User prompt
The headwinds and thermals have disappeared
User prompt
I'm unable to control the seagull with the arrow keys
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'ArrowUp')' in or related to this line: 'if (LK.keys["ArrowUp"]) {' Line Number: 35
User prompt
Seagull starts at the bottom center of the screen. It is controled by the arrow keys.
Initial prompt
Soaring Over the Sea
/**** * Classes ****/ // Headwind class var Headwind = Container.expand(function () { var self = Container.call(this); var headwindGraphics = self.attachAsset('headwind', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { self.y += 3; }; }); //<Assets used in the game will automatically appear here> // Seagull class var Seagull = Container.expand(function () { var self = Container.call(this); var seagullGraphics = self.attachAsset('seagull', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 1; self.update = function () { // Move the seagull towards the top of the screen self.y -= self.speed; }; }); // Thermal class var Thermal = Container.expand(function () { var self = Container.call(this); var thermalGraphics = self.attachAsset('thermal', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { self.y += 2; }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB //Init game with sky blue background }); /**** * Game Code ****/ var seagull = game.addChild(new Seagull()); seagull.x = 2048 / 2; seagull.y = 2732 - 200; var thermals = []; var headwinds = []; var score = 0; var scoreTxt = new Text2('0', { size: 150, fill: "#ffffff" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); function handleMove(x, y, obj) { seagull.x = x; } game.move = handleMove; game.update = function () { for (var i = thermals.length - 1; i >= 0; i--) { if (thermals[i].intersects(seagull)) { score += 10; LK.setScore(score); scoreTxt.setText(score); thermals[i].destroy(); thermals.splice(i, 1); } if (thermals[i] && thermals[i].y > 2732) { thermals[i].destroy(); thermals.splice(i, 1); } } for (var j = headwinds.length - 1; j >= 0; j--) { if (headwinds[j].intersects(seagull)) { seagull.y += 200; // Push the seagull back twice as far headwinds[j].destroy(); // Destroy the headwind headwinds.splice(j, 1); } if (headwinds[j] && headwinds[j].y > 2732) { headwinds[j].destroy(); headwinds.splice(j, 1); } } if (LK.ticks % 60 == 0) { var newThermal = new Thermal(); newThermal.x = Math.random() * 2048; newThermal.y = -50; thermals.push(newThermal); game.addChild(newThermal); } if (LK.ticks % 90 == 0) { var newHeadwind = new Headwind(); newHeadwind.x = Math.random() * 2048; newHeadwind.y = -50; headwinds.push(newHeadwind); game.addChild(newHeadwind); } // Check if the seagull reaches the top edge of the screen if (seagull.y <= 0) { // Show game over with a win message LK.showGameOver("Congratulations! You've won the game."); } };
===================================================================
--- original.js
+++ change.js
@@ -19,10 +19,13 @@
var seagullGraphics = self.attachAsset('seagull', {
anchorX: 0.5,
anchorY: 0.5
});
- self.speed = 5;
- self.update = function () {};
+ self.speed = 1;
+ self.update = function () {
+ // Move the seagull towards the top of the screen
+ self.y -= self.speed;
+ };
});
// Thermal class
var Thermal = Container.expand(function () {
var self = Container.call(this);
@@ -99,5 +102,10 @@
newHeadwind.y = -50;
headwinds.push(newHeadwind);
game.addChild(newHeadwind);
}
+ // Check if the seagull reaches the top edge of the screen
+ if (seagull.y <= 0) {
+ // Show game over with a win message
+ LK.showGameOver("Congratulations! You've won the game.");
+ }
};
\ No newline at end of file
whirling spiral wind squiggles. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
fluffy cloud. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
storm cloud. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
ocean surface overhead view. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
cresting wave. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
seagull with wings spread, seen from above. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
lightning bolt. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.