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
User prompt
Please fix the bug: 'road.clone is not a function' in or related to this line: 'var background2 = road.clone();' Line Number: 50
User prompt
Please fix the bug: 'ReferenceError: background1 is not defined' in or related to this line: 'background1.x -= 5;' Line Number: 50
Code edit (1 edits merged)
Please save this source code
User prompt
add the road movement from right to left end of the screen until the game time is stopped
User prompt
make the background movement as a side scroller from right to left
Code edit (4 edits merged)
Please save this source code
User prompt
turn the game movement from right to left
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting 'x')' in or related to this line: 'background2.x = 0;' Line Number: 60
User prompt
turn the game movement from left to right
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'ArrowRight')' in or related to this line: 'if (LK.keys['ArrowRight']) {' Line Number: 32
/**** * Classes ****/ var Bike = Container.expand(function () { var self = Container.call(this); var bikeGraphics = self.attachAsset('bike', { anchorX: 3, anchorY: 3, scaleX: 3, scaleY: 4 }); }); 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 bike = road.addChild(new Bike()); bike.x = 2048 / 2; bike.y = 2732 / 2;
===================================================================
--- original.js
+++ change.js
@@ -8,14 +8,8 @@
anchorY: 3,
scaleX: 3,
scaleY: 4
});
- self.update = function () {
- self.x -= 5;
- if (self.x < -2048) {
- self.x = 2048;
- }
- };
});
var Road = Container.expand(function () {
var self = Container.call(this);
var roadGraphics = self.attachAsset('road', {
@@ -36,7 +30,7 @@
****/
var road = game.addChild(new Road());
road.x = 2048 / 2;
road.y = 2732 / 2;
-var bike = game.addChild(new Bike());
+var bike = road.addChild(new Bike());
bike.x = 2048 / 2;
bike.y = 2732 / 2;
\ No newline at end of file
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