Code edit (7 edits merged)
Please save this source code
User prompt
keep the player position at bottom of the screen
User prompt
keep the player position at bottom of the screen
Code edit (2 edits merged)
Please save this source code
User prompt
keep the player movement infinte dont snap to start position
Code edit (1 edits merged)
Please save this source code
User prompt
keep the player movement slowly moving toward right sideways
User prompt
add a player onto the game with moving right side of the screen along with the game movement
User prompt
turn it into side scroller with moving forward infinetly
User prompt
make a asset for game background instead of backgroundcolor
User prompt
remove everything
User prompt
make platform asset as a background sidescroller with looping
User prompt
create a game like super mario bros
User prompt
remove everything
User prompt
with this side scroller create a game like super Mario bros
User prompt
change this into a side scroller
User prompt
create a super mario bros game
User prompt
create Doodle Cricket Game
User prompt
create a cricket game which is similar to doodle cricket in google
User prompt
create a cricket game
User prompt
unpublish
User prompt
delete everything
User prompt
fit the background image on fullscreen of player
User prompt
generate a cricket field background with people cheering
Initial prompt
Cricket
/**** * Classes ****/ var Background = Container.expand(function () { var self = Container.call(this); var backgroundGraphics = self.attachAsset('platform', { anchorX: 0.0, anchorY: 0.0 }); self.speed = -2; self.update = function () { self.x += self.speed; if (self.x <= -2048) { self.x = 2048; } }; }); var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -2; self.update = function () { self.x += self.speed; }; }); var Platform = Container.expand(function () { var self = Container.call(this); var platformGraphics = self.attachAsset('platform', { anchorX: 0.5, anchorY: 0.5 }); }); var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('mario', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.jumpHeight = 10; self.isJumping = false; self.update = function () { if (self.isJumping) { self.y -= self.jumpHeight; self.jumpHeight -= 0.5; if (self.jumpHeight <= 0) { self.isJumping = false; self.jumpHeight = 10; } } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ var player = game.addChild(new Player()); player.x = 100; player.y = 100; var background1 = game.addChild(new Background()); background1.x = 0; background1.y = 0; var background2 = game.addChild(new Background()); background2.x = 2048; background2.y = 0; var enemy = game.addChild(new Enemy()); enemy.x = 500; enemy.y = 200;
===================================================================
--- original.js
+++ change.js
@@ -1,7 +1,21 @@
/****
* Classes
****/
+var Background = Container.expand(function () {
+ var self = Container.call(this);
+ var backgroundGraphics = self.attachAsset('platform', {
+ anchorX: 0.0,
+ anchorY: 0.0
+ });
+ self.speed = -2;
+ self.update = function () {
+ self.x += self.speed;
+ if (self.x <= -2048) {
+ self.x = 2048;
+ }
+ };
+});
var Enemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.attachAsset('enemy', {
anchorX: 0.5,
@@ -52,10 +66,13 @@
****/
var player = game.addChild(new Player());
player.x = 100;
player.y = 100;
-var platform = game.addChild(new Platform());
-platform.x = 100;
-platform.y = 200;
+var background1 = game.addChild(new Background());
+background1.x = 0;
+background1.y = 0;
+var background2 = game.addChild(new Background());
+background2.x = 2048;
+background2.y = 0;
var enemy = game.addChild(new Enemy());
enemy.x = 500;
enemy.y = 200;
\ 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