User prompt
Little bit up
User prompt
Hero spawn at left side
User prompt
Dot move as user wants
User prompt
Create a dot
User prompt
The obstacle move opposite
User prompt
The obstacle move downward from Upward
User prompt
Change the direction of obstacle
User prompt
The obstacle move from Upward to downward
User prompt
Create a button of left
User prompt
Come
User prompt
The obstacles come from Upward
User prompt
Stop the obstacles
Initial prompt
1. City Sprint
===================================================================
--- original.js
+++ change.js
@@ -1,7 +1,17 @@
/****
* Classes
****/
+var Dot = Container.expand(function () {
+ var self = Container.call(this);
+ var dotGraphics = self.attachAsset('dot', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.update = function () {
+ // Update logic for the dot, if needed
+ };
+});
// Assets will be automatically created and loaded by the LK engine based on their usage in the code.
// For example, if you use LK.getAsset('hero'), the engine will automatically create and load an asset with the id 'hero'.
// Hero class representing the player character
var Hero = Container.expand(function () {
@@ -58,8 +68,11 @@
hero.x = 2048 / 2;
hero.y = 2732 - 200;
var obstacles = [];
var leftButton = game.addChild(new LeftButton());
+var dot = game.addChild(new Dot());
+dot.x = 2048 / 2;
+dot.y = 2732 / 2;
var score = 0;
var scoreTxt = new Text2('0', {
size: 150,
fill: "#ffffff"
Right button. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Road. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Road Car. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Coin. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.