Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'dust is not defined' in or related to this line: 'dust.x = i;' Line Number: 123
Code edit (1 edits merged)
Please save this source code
User prompt
fade out the skidmarks
User prompt
leave skidmarks from 4 tires when turning
Code edit (7 edits merged)
Please save this source code
User prompt
add friction so the car drifts when turning
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: console is not a function' in or related to this line: 'console(dx);' Line Number: 119
Code edit (1 edits merged)
Please save this source code
User prompt
change the steering so that dragging left rotates the car and dragging right rotates the car
User prompt
rotate relative to position on screen, continously on down
User prompt
add drifting
User prompt
Please fix the bug: 'ReferenceError: x is not defined' in or related to this line: 'var distanceFromMid = x - midScreenX;' Line Number: 63
Code edit (1 edits merged)
Please save this source code
User prompt
rotation should keep increasing when down, based on distanceFromMid
User prompt
update and increase rotation when down
User prompt
car is moving right when it should move up
Code edit (9 edits merged)
Please save this source code
User prompt
Assume the car is facing up at start
User prompt
car shoud move the direction its facing
User prompt
update distanceFromMid on move (when down)
User prompt
rotate car on down buy a number relative to distance from screen x mid
Code edit (2 edits merged)
Please save this source code
User prompt
move car.down to game.down
/****
* Classes
****/
var Car = Container.expand(function () {
var self = Container.call(this);
var carGraphics = self.attachAsset('car', {
anchorX: 0.5,
anchorY: 0.5
});
self.acceleration = 0;
});
var Dust = Container.expand(function () {
var self = Container.call(this);
var dustGraphics = self.attachAsset('dirt', {
anchorX: 0.5,
anchorY: 0.5
});
});
var Obstacle = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = -5;
self.update = function () {
self.y -= self.speed;
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2e2e2e
});
/****
* Game Code
****/
game.down = function (x, y, obj) {
car.acceleration += 1;
};
var obstacles = [];
game.update = function () {
car.y -= car.acceleration;
car.acceleration *= 0.98; // Apply friction to slow down the car
if (car.y < 0) {
car.y = 0;
car.acceleration = 0;
}
if (car.y > 2732) {
car.y = 2732;
car.acceleration = 0;
}
};
var car = game.addChild(new Car());
car.x = 2048 / 2;
car.y = 2732 / 2 + 500;
for (var i = 0; i < 2048; i += 100) {
for (var j = 0; j < 2732; j += 100) {
if (Math.random() < 0.1) {
var dust = game.addChildAt(new Dust(), 0);
dust.x = i;
dust.y = j;
}
}
}
; /****
* Classes
****/
var Car = Container.expand(function () {
var self = Container.call(this);
var carGraphics = self.attachAsset('car', {
anchorX: 0.5,
anchorY: 0.5
});
self.acceleration = 0;
});
var Dust = Container.expand(function () {
var self = Container.call(this);
var dustGraphics = self.attachAsset('dirt', {
anchorX: 0.5,
anchorY: 0.5
});
});
var Obstacle = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = -5;
self.update = function () {
self.y -= self.speed;
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2e2e2e
});
/****
* Game Code
****/
game.down = function (x, y, obj) {
car.acceleration += 1;
};
var obstacles = [];
game.update = function () {
car.y -= car.acceleration;
car.acceleration *= 0.98; // Apply friction to slow down the car
if (car.y < 0) {
car.y = 0;
car.acceleration = 0;
}
if (car.y > 2732) {
car.y = 2732;
car.acceleration = 0;
}
};
var car = game.addChild(new Car());
car.x = 2048 / 2;
car.y = 2732 / 2 + 500;
for (var i = 0; i < 2048; i += 100) {
for (var j = 0; j < 2732; j += 100) {
if (Math.random() < 0.1) {
var dust = game.addChildAt(new Dust(), 0);
dust.x = i;
dust.y = j;
}
}
}
;
A cute looking car, facing up, viewed top down. Suitable for a game. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
some dust Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
An arrow pointing upwards. Should look like it's pointing to something valuable. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a orange road cone. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a coffee cup, viewed from above. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A cinnamon bun, viewed from above. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a gold coin with a car one it, simple graphics. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a cheese sandwich, viewed from above. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a salt can, viewed from above. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A checked pattern in nice soft pastel colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.