User prompt
Randomize obstacles loading places from the top of the map
User prompt
Ensure that obstacles never cover each other
User prompt
Add ccrcar2 asset to obstacle class
User prompt
Reduce the number of ccrcars to half ✅ Reduce the number of ccrcars to
User prompt
Reduce the number of motorracers to half
User prompt
Reduce the number of motorracers to half
User prompt
Reduce the number of ccrcars to half
User prompt
YOU STILL DOING IT WRONG!!!! Repair the obstacle bug! Add ccrcar to the map as obstacle and add motorracer to the map as obstacle!!!!!!!
User prompt
I will add more obstacle types so repair this bug
User prompt
Add motorracer asset to the obstacle class
User prompt
Add ccrcar asset to the obstacle class
User prompt
Add ccrcars to obstacle
User prompt
Reduce the motorracers to the half
User prompt
Rename obstacle asset to motorracer asset
User prompt
Increase the road speed to the 5x
User prompt
Increase the road speed to the 10x
User prompt
Set loop to background load Infinity
User prompt
Add road asset to background
User prompt
Add sky to the background
User prompt
The player can controll by swipe
User prompt
Rename player to Car
User prompt
Player only move horizontal at the bottom of the map
Initial prompt
Dakar
/**** * Classes ****/ // Define the Obstacle class var Obstacle = Container.expand(function () { var self = Container.call(this); var obstacleGraphics; if (Math.random() > 0.5) { obstacleGraphics = self.attachAsset('motorracer', { anchorX: 0.5, anchorY: 0.5 }); } else { obstacleGraphics = self.attachAsset('ccrcar', { anchorX: 0.5, anchorY: 0.5 }); } self.speed = 3; self.update = function () { self.y += self.speed; if (self.y > 2732) { self.y = -self.height; } }; }); //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> // Define the Player class var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { // Player update logic }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ var road = game.attachAsset('road', { anchorX: 0.5, anchorY: 0.5 }); road.x = 2048 / 2; road.y = 2732 / 2; // Initialize player var player = new Player(); player.x = 2048 / 2; player.y = 2732 - 200; game.addChild(player); // Initialize obstacles var obstacles = []; for (var i = 0; i < 3; i++) { var obstacle = new Obstacle(); obstacle.x = Math.random() * 2048; obstacle.y = Math.random() * 2732; obstacles.push(obstacle); game.addChild(obstacle); } // Handle touch events for player movement game.down = function (x, y, obj) { this.startX = x; }; game.move = function (x, y, obj) { if (this.startX) { var deltaX = x - this.startX; this.startX = x; player.x += deltaX; } }; game.up = function (x, y, obj) { this.startX = null; }; // Update game logic game.update = function () { player.update(); obstacles.forEach(function (obstacle) { obstacle.update(); if (player.intersects(obstacle)) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } }); // Move the road downwards to create an illusion of player moving forward road.y += 25; // If the road has moved off the screen, reset its position to create a loop if (road.y > 2732) { road.y = 0; } };
===================================================================
--- original.js
+++ change.js
@@ -3,12 +3,20 @@
****/
// Define the Obstacle class
var Obstacle = Container.expand(function () {
var self = Container.call(this);
- var motorracerGraphics = self.attachAsset('motorracer', {
- anchorX: 0.5,
- anchorY: 0.5
- });
+ var obstacleGraphics;
+ if (Math.random() > 0.5) {
+ obstacleGraphics = self.attachAsset('motorracer', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ } else {
+ obstacleGraphics = self.attachAsset('ccrcar', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ }
self.speed = 3;
self.update = function () {
self.y += self.speed;
if (self.y > 2732) {
@@ -54,13 +62,13 @@
game.addChild(player);
// Initialize obstacles
var obstacles = [];
for (var i = 0; i < 3; i++) {
- var motorracer = new Obstacle();
- motorracer.x = Math.random() * 2048;
- motorracer.y = Math.random() * 2732;
- obstacles.push(motorracer);
- game.addChild(motorracer);
+ var obstacle = new Obstacle();
+ obstacle.x = Math.random() * 2048;
+ obstacle.y = Math.random() * 2732;
+ obstacles.push(obstacle);
+ game.addChild(obstacle);
}
// Handle touch events for player movement
game.down = function (x, y, obj) {
this.startX = x;
Photorealistic crossmotor racer, from back and verytop view
Photorealistic Cross-Country Dakar-Rally-Car from back,Top view.
Photorealistic Cross-Country Dakar-Rally-Car from topback view.
Photorealistic Dakar-Rally-Truck from back, Top view.
TOTALY SMOOT SANDROAD TEXTURE TOP VIEW
DUNE BUSH, TOP VIEW
Black fuelindicator no-gauge, with chrome round frame, white levelindicators, front view.