User prompt
Restore Ferrari color to original
User prompt
Please fix the bug: 'ReferenceError: obstacles is not defined' in or related to this line: 'for (var i = obstacles.length - 1; i >= 0; i--) {' Line Number: 145
User prompt
Rename car asset to Mercedes
User prompt
Please fix the bug: 'ReferenceError: obstacles is not defined' in or related to this line: 'for (var i = obstacles.length - 1; i >= 0; i--) {' Line Number: 145
User prompt
rename obstacle to Ferrari
User prompt
Az utolsó parancsom visszavonása
User prompt
Recolor the look of your obstaclek. Have more Red Bull in it
User prompt
Create a frame asset for each left and right side of the map
User prompt
remove and delete left and right side assets
User prompt
the background should not obscure leftSideAsset
User prompt
Add 2 assets to the left and right sides of the map
User prompt
Add rocking stones to the left and right sides of the track
User prompt
The minimum distance between each obstacle is 200 units
User prompt
The distance between each obstacle and the left and right edges of the track is 200 units
User prompt
None of the obstacle assets can touch each other.
User prompt
None of the obstacle assets shall affect each other
User prompt
None of the obstacles should touch each other
User prompt
There should be a minimum of 100units of arrow distance around each obstacle
User prompt
There should be a minimum distance of 100 units around each obstacle
User prompt
There should be a minimum distance of 30 units around each obstacle
User prompt
Only 5 obstacles should be on the track at the same time
User prompt
Only 3 obstacles should be on the track at the same time
User prompt
Move the car 77 units up
User prompt
Move the car 100 units up
User prompt
Move the car 50 units up
/**** * Classes ****/ //<Assets used in the game will automatically appear here> // Car class var Car = Container.expand(function () { var self = Container.call(this); var carGraphics = self.attachAsset('car', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 0; self.maxSpeed = 10; self.acceleration = 0.2; self.deceleration = 0.1; self.update = function () { self.y -= self.speed; if (self.speed > 0) { self.speed -= self.deceleration; } }; self.accelerate = function () { if (self.speed < self.maxSpeed) { self.speed += self.acceleration; } }; }); // Obstacle class var Obstacle = Container.expand(function () { var self = Container.call(this); var obstacleGraphics = self.attachAsset('obstacle', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5 / 1.5; self.update = function () { self.y += self.speed; if (self.y > 2732) { self.destroy(); var index = obstacles.indexOf(self); if (index > -1) { obstacles.splice(index, 1); } } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ var racetrack = LK.getAsset('racetrack', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(racetrack); var car = game.addChild(new Car()); car.x = 2048 / 2; car.y = 2732 - 200 - 77; var obstacles = []; var score = 0; var scoreTxt = new Text2('0', { size: 150, fill: "#ffffff" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); function spawnObstacle() { if (obstacles.length < 5) { var obstacle = new Obstacle(); var randomColor = Math.floor(Math.random() * 0xFFFFFF); obstacle.children[0].tint = randomColor; var validPosition = false; while (!validPosition) { obstacle.x = 200 + Math.random() * (2048 - 400); validPosition = true; for (var i = 0; i < obstacles.length; i++) { if (Math.abs(obstacle.x - obstacles[i].x) < 100) { validPosition = false; break; } } } var validYPosition = false; while (!validYPosition) { obstacle.y = -100; validYPosition = true; for (var i = 0; i < obstacles.length; i++) { if (Math.abs(obstacle.y - obstacles[i].y) < 100) { validYPosition = false; break; } } } obstacles.push(obstacle); game.addChild(obstacle); } } function updateScore() { score += 1; scoreTxt.setText(score); } game.move = function (x, y, obj) { car.x = x; }; game.update = function () { car.update(); // Ensure car does not move out of bounds if (car.x < 0) { car.x = 0; } else if (car.x > 2048) { car.x = 2048; } for (var i = obstacles.length - 1; i >= 0; i--) { obstacles[i].update(); if (car.intersects(obstacles[i])) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } } if (LK.ticks % 60 == 0) { spawnObstacle(); updateScore(); } };
===================================================================
--- original.js
+++ change.js
@@ -79,12 +79,12 @@
var randomColor = Math.floor(Math.random() * 0xFFFFFF);
obstacle.children[0].tint = randomColor;
var validPosition = false;
while (!validPosition) {
- obstacle.x = Math.random() * 2048;
+ obstacle.x = 200 + Math.random() * (2048 - 400);
validPosition = true;
for (var i = 0; i < obstacles.length; i++) {
- if (Math.abs(obstacle.x - obstacles[i].x) < 100 && Math.abs(obstacle.y - obstacles[i].y) < 100) {
+ if (Math.abs(obstacle.x - obstacles[i].x) < 100) {
validPosition = false;
break;
}
}
@@ -93,9 +93,9 @@
while (!validYPosition) {
obstacle.y = -100;
validYPosition = true;
for (var i = 0; i < obstacles.length; i++) {
- if (Math.abs(obstacle.x - obstacles[i].x) < 100 && Math.abs(obstacle.y - obstacles[i].y) < 100) {
+ if (Math.abs(obstacle.y - obstacles[i].y) < 100) {
validYPosition = false;
break;
}
}
grass top view.
Add more dark carbon fiber background and resize the picture to 16:9
F1 race car. Glossy blue body painting and half covered with planet blue Earth. Blue front wing. myearthdream.com text on black rear wing. 7 number on the nose of the car. Red Honda logo with White R logo on the nose of the car. Top view.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
F1 Jaguair race car. Shiny green body. white Jaguar animal logo on body. thin red and white stripes. white front wings and white rear wing. TOP VIEW!. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
RedBull F1 race car. Top view. Royalblue body with Shinyred lines on sides. Silver bull-body. Silver ,,BlueBull" sponsors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Black McLaren MP4-29 F1 RACE CAR with red lines and white,,RONDA"text. TOP VIEW.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Photorealistic F1 McLaren race car, Top view. Orange coloured body and black thick stripe with white Chrome text where the o letter is Google chrome logo. Skyblue lines on nose sides. Silver 4 number on nose. Black OKX text on rear wing.
Photorealistic F1 race car without Halo safety device. Top view. White body with neongreen nose. Black BrainGP text on body sides. Red "Cainon" text on front wings. Neongreen rear wing with Orange "BRAWNDO" text.
Photorealistic RedBull f1 car top view. Replace RedBull text to RealBull text.
Photorealistic Cadillac F1 race car, top view. Replace Cadillac text to golden coloured ,,Cadillaic" text on black rear wing. Big American flag on white body. White ,,Andretti" and gm text on black front wing.
Photorealistic Porsche F1 race car, top view. Golden logo on car nose. White body with black rear and front wing. Very thick red lines on body from front wing to rear wing. Replace Porsche text to white coloured ,,Porshe" text on rear wing.
Photorealistic Renault F1 race car, top view. Bright skyblue body. Banana Yellow nose with blue sidelines. Royalblue Front and Rear wing. Neon-yellow ,,Telefonicai" text on rearwing. White ,,TEAM SPIRIT" text on nose. Blue ,,RENAIULT" text on body.