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
@@ -14,8 +14,20 @@
self.update = function () {
// Update logic for the hero, such as movement
};
});
+var LeftButton = Container.expand(function () {
+ var self = Container.call(this);
+ var buttonGraphics = self.attachAsset('leftButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.x = 150;
+ self.y = 2732 - 150;
+ self.down = function (x, y, obj) {
+ hero.x -= hero.speed;
+ };
+});
// Obstacle class representing obstacles in the game
var Obstacle = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.attachAsset('obstacle', {
@@ -45,8 +57,9 @@
var hero = game.addChild(new Hero());
hero.x = 2048 / 2;
hero.y = 2732 - 200;
var obstacles = [];
+var leftButton = game.addChild(new LeftButton());
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.