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
Code edit (2 edits merged)
Please save this source code
User prompt
remove assets and logic of add some changes to remove the feel of repeating the same background for player
User prompt
add some changes to remove the feel of repeating the same background for player
Code edit (6 edits merged)
Please save this source code
User prompt
add jump for bike when left click is pressed
Code edit (1 edits merged)
Please save this source code
Code edit (9 edits merged)
Please save this source code
User prompt
control the speed of the background movement
User prompt
control the speed of the background movement
Code edit (9 edits merged)
Please save this source code
User prompt
spawn the bike at left start of the screen
Code edit (1 edits merged)
Please save this source code
Code edit (11 edits merged)
Please save this source code
User prompt
fix the bike disapperaing
User prompt
fix the bike when it disapperas on background2
User prompt
fix the bike postion when it disapperas on background2
User prompt
fix the background2 position on the screen correctly
User prompt
fix the background2 position on the screen correctly
Code edit (2 edits merged)
Please save this source code
User prompt
dont reset the bike postion
Code edit (1 edits merged)
Please save this source code
/**** * Classes ****/ var Bike = Container.expand(function () { var self = Container.call(this); var bikeGraphics = self.attachAsset('bike', { anchorX: -2, anchorY: -2, scaleX: 3, scaleY: 3 }); self.update = function () { self.x += 5; if (self.x > 2048) { self.x = -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()); bike.x = 0; bike.y = 2732 / 2; game.update = function () { background1.x -= 5; background2.x -= 5; if (background1.x <= -1024) { background1.x = background2.x + 2048; } if (background2.x <= -1024) { background2.x = background1.x + 2048; } };
===================================================================
--- original.js
+++ change.js
@@ -3,12 +3,12 @@
****/
var Bike = Container.expand(function () {
var self = Container.call(this);
var bikeGraphics = self.attachAsset('bike', {
- anchorX: -1,
+ anchorX: -2,
anchorY: -2,
scaleX: 3,
- scaleY: 4
+ scaleY: 3
});
self.update = function () {
self.x += 5;
if (self.x > 2048) {
@@ -42,9 +42,9 @@
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());
-bike.x = 2048 / 2;
+bike.x = 0;
bike.y = 2732 / 2;
game.update = function () {
background1.x -= 5;
background2.x -= 5;
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