User prompt
add the car to the middle of the screen
User prompt
add a car class
User prompt
remove all code and start over
Code edit (1 edits merged)
Please save this source code
User prompt
center car pivox
User prompt
car should face upwards on start
User prompt
center pivot on car
User prompt
obstacles should be placed randomly, starting from car position. And there should be a minimal distance between them
User prompt
the rotation should be relative to car position
User prompt
add more obstacles
User prompt
add some obstacles to avoid
User prompt
make the car center of view
User prompt
keep the car rotation between updates and keep rotating depending on where you press
User prompt
in game.move, let the argument to car.drift be a variable from -1 to 1, depending on left/right on sceen
User prompt
decrease acceleration
User prompt
rotate less
User prompt
car is moving weird, can you fix?
User prompt
face upwars from the start
User prompt
car should move in the direction its facing
User prompt
rotate left when pressing on left side
User prompt
car should have 4 tires
User prompt
add tires
User prompt
keep rotating if down
Code edit (1 edits merged)
Please save this source code
User prompt
rotate right on when down on right side of screen
/****
* Classes
****/
var Car = Container.expand(function () {
var self = Container.call(this);
var carGraphics = self.attachAsset('car', {
anchorX: 0.5,
anchorY: 0.5
});
carGraphics.rotation = Math.PI / 2; // Rotation are in radians
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
}); ===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,18 @@
-/****
+/****
+* Classes
+****/
+var Car = Container.expand(function () {
+ var self = Container.call(this);
+ var carGraphics = self.attachAsset('car', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ carGraphics.rotation = Math.PI / 2; // Rotation are in radians
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
backgroundColor: 0x000000
});
\ No newline at end of file
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.