User prompt
No jumping
User prompt
Fire bullet when touch screen
User prompt
Stop jumping when touch screen
User prompt
Create background effect that runs smoothly ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Score a point when bullet hits enemy
User prompt
Update background movement to move
User prompt
Fix background so it does not go blank
User prompt
Stretch background
User prompt
Make background move slowly to the left
User prompt
Create bullets that fire from the car and move to the right
User prompt
Create moving background loop and speed up faster
User prompt
Make background move fast
User prompt
Speed up background movement
User prompt
Make background move slowly
User prompt
Fix scoring system
User prompt
Make score text larger bold and visible
User prompt
Add a score tally at top of the screen score one point every time player successfully jumps over fire
User prompt
Please fix the bug: 'scoreText is not defined' in or related to this line: 'LK.gui.top.addChild(scoreText);' Line Number: 117
User prompt
Please fix the bug: 'ReferenceError: scoreTxt is not defined' in or related to this line: 'scoreTxt.setText(LK.getScore());' Line Number: 75
User prompt
Score points every time player jumps fire
User prompt
Make car jump higher
User prompt
Add fire obstacles player dies if hot fire
User prompt
Create fire obstacles player dies if they hit fore
User prompt
Increase background speed
User prompt
Speed up background
/**** * Classes ****/ // Define a class for the fire obstacle var Fire = Container.expand(function () { var self = Container.call(this); var fireGraphics = self.attachAsset('fire', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.x -= self.speed; if (self.x <= -300) { self.x = 2048 + 300; } }; }); // Define a class for the moving background var MovingBackground = Container.expand(function () { var self = Container.call(this); var backgroundGraphics = self.attachAsset('background', { anchorX: 0, anchorY: 0 }); self.speed = 10; self.update = function () { self.x -= self.speed; if (self.x <= -2048) { self.x = 2048; } }; }); //<Assets used in the game will automatically appear here> // Define a class for the player character var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.jumpHeight = 40; self.isJumping = false; self.velocityY = 0; self.update = function () { if (self.isJumping) { self.y += self.velocityY; self.velocityY += 0.7; // Decreased gravity effect by 30% if (self.y >= 2732 / 2) { // Ground level self.y = 2732 / 2; self.isJumping = false; self.velocityY = 0; } } }; self.jump = function () { if (!self.isJumping) { self.isJumping = true; self.velocityY = -self.jumpHeight; } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB // Sky blue background }); /**** * Game Code ****/ // Initialize the moving background var background1 = game.addChild(new MovingBackground()); background1.x = 0; background1.y = 0; var background2 = game.addChild(new MovingBackground()); background2.x = 2048; background2.y = 0; // Initialize fire obstacle var fire = game.addChild(new Fire()); fire.x = 2048 + 300; fire.y = 2732 / 2; // Initialize player var player = game.addChild(new Player()); player.x = 2048 / 2; player.y = 2732 / 2; var scoreText = new Text2('0', { size: 100, fill: 0xFFFFFF }); // Add the score text to the game GUI at the top center of the screen LK.gui.top.addChild(scoreText); scoreText.x = 2048 / 2; scoreText.y = 0; // Handle game updates game.update = function () { player.update(); background1.update(); background2.update(); // Update fire obstacle fire.update(); // Check for collision between the player and the fire obstacle if (player.intersects(fire)) { // Show game over. The game will be automatically paused while game over is showing. LK.showGameOver(); } // Spawn enemies }; // Handle player jump game.down = function (x, y, obj) { player.jump(); };
/****
* Classes
****/
// Define a class for the fire obstacle
var Fire = Container.expand(function () {
var self = Container.call(this);
var fireGraphics = self.attachAsset('fire', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 5;
self.update = function () {
self.x -= self.speed;
if (self.x <= -300) {
self.x = 2048 + 300;
}
};
});
// Define a class for the moving background
var MovingBackground = Container.expand(function () {
var self = Container.call(this);
var backgroundGraphics = self.attachAsset('background', {
anchorX: 0,
anchorY: 0
});
self.speed = 10;
self.update = function () {
self.x -= self.speed;
if (self.x <= -2048) {
self.x = 2048;
}
};
});
//<Assets used in the game will automatically appear here>
// Define a class for the player character
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.attachAsset('player', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 5;
self.jumpHeight = 40;
self.isJumping = false;
self.velocityY = 0;
self.update = function () {
if (self.isJumping) {
self.y += self.velocityY;
self.velocityY += 0.7; // Decreased gravity effect by 30%
if (self.y >= 2732 / 2) {
// Ground level
self.y = 2732 / 2;
self.isJumping = false;
self.velocityY = 0;
}
}
};
self.jump = function () {
if (!self.isJumping) {
self.isJumping = true;
self.velocityY = -self.jumpHeight;
}
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB // Sky blue background
});
/****
* Game Code
****/
// Initialize the moving background
var background1 = game.addChild(new MovingBackground());
background1.x = 0;
background1.y = 0;
var background2 = game.addChild(new MovingBackground());
background2.x = 2048;
background2.y = 0;
// Initialize fire obstacle
var fire = game.addChild(new Fire());
fire.x = 2048 + 300;
fire.y = 2732 / 2;
// Initialize player
var player = game.addChild(new Player());
player.x = 2048 / 2;
player.y = 2732 / 2;
var scoreText = new Text2('0', {
size: 100,
fill: 0xFFFFFF
});
// Add the score text to the game GUI at the top center of the screen
LK.gui.top.addChild(scoreText);
scoreText.x = 2048 / 2;
scoreText.y = 0;
// Handle game updates
game.update = function () {
player.update();
background1.update();
background2.update();
// Update fire obstacle
fire.update();
// Check for collision between the player and the fire obstacle
if (player.intersects(fire)) {
// Show game over. The game will be automatically paused while game over is showing.
LK.showGameOver();
}
// Spawn enemies
};
// Handle player jump
game.down = function (x, y, obj) {
player.jump();
};
🔥 fire. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Mario driving a tank. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Wario flying an aeroplane. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Waluigi flying a helicopter. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows