User prompt
make obstacle2 falling from the top of the screen
User prompt
remove randomize the vertical spawn position for obstacle2
Code edit (1 edits merged)
Please save this source code
User prompt
make obstacle2 like falling from the sky
User prompt
remove the collison between obstacle and player and game over screen also
User prompt
make obstacle2 like falling from the sky
User prompt
remove the obstacle collison and game over
Code edit (7 edits merged)
Please save this source code
User prompt
random the obstacle2 spawn position
Code edit (3 edits merged)
Please save this source code
User prompt
create another asset and assign the same logic as obstacle and name it as obstacle2
Code edit (1 edits merged)
Please save this source code
User prompt
if the bike collide with obstacle the game will be over
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
spawn the obstacle for every random 30 seconds
Code edit (14 edits merged)
Please save this source code
User prompt
spawn the obstacle for every 5 seconds
Code edit (4 edits merged)
Please save this source code
User prompt
dont reset the obstacle position
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
spawn obstacle on the road in game on right side of the screen
User prompt
spawn the obstacle on the game
User prompt
add obstacles on the road
/**** * Classes ****/ var Bike = Container.expand(function () { var self = Container.call(this); var bikeGraphics = self.attachAsset('bike', { anchorX: 0, anchorY: -2.5, scaleX: 3, scaleY: 3 }); self.update = function () { self.x += 0.5; if (self.x > 2048) { self.x = -100; } }; self.jumping = false; self.jumpCounter = 0; }); var Obstacle = Container.expand(function () { var self = Container.call(this); var obstacleGraphics = self.attachAsset('obstacle', { anchorX: 0.5, anchorY: 0.5, scaleX: 1, scaleY: 1 }); self.update = function () { self.x -= 20; if (self.x < -100) { self.x = 2048 + 100; } }; }); var Road = Container.expand(function () { var self = Container.call(this); var roadGraphics = self.attachAsset('road', { anchorX: 0.5, anchorY: 0.5 }); }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ var road = game.addChild(new Road()); road.x = 2048 / 2; road.y = 2732 / 2; var background1 = road; var background2 = new Road(); game.addChild(background2); background2.x = background1.x + 2048; background2.y = 2732 / 2; // Position background2 at the center of the screen vertically var bike = game.addChild(new Bike()); var obstacle = game.addChild(new Obstacle()); obstacle.x = 2048; obstacle.y = 2732 / 2; bike.x = 0; bike.y = 2732 / 2; game.update = function () { background1.x -= 20; background2.x -= 20; if (background1.x <= -1024) { background1.x = background2.x + 2048; } if (background2.x <= -1024) { background2.x = background1.x + 2048; } if (bike.jumping) { bike.y -= 20; bike.jumpCounter++; if (bike.jumpCounter > 20) { bike.jumping = false; } } else if (bike.y < 2732 / 2) { bike.y += 10; } else { bike.jumpCounter = 0; } }; game.down = function (x, y, obj) { if (!bike.jumping) { bike.jumping = true; } };
===================================================================
--- original.js
+++ change.js
@@ -60,9 +60,9 @@
background2.x = background1.x + 2048;
background2.y = 2732 / 2; // Position background2 at the center of the screen vertically
var bike = game.addChild(new Bike());
var obstacle = game.addChild(new Obstacle());
-obstacle.x = 2048 / 2;
+obstacle.x = 2048;
obstacle.y = 2732 / 2;
bike.x = 0;
bike.y = 2732 / 2;
game.update = function () {
sci fi bike with person riding facing right side Single Game Texture. In-Game asset. High contrast. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
sci fi bike with person riding facing right side Single Game Texture. In-Game asset. High contrast.
asteroid falling diffrent colors Single Game Texture. In-Game asset. High contrast. No Background