+ 7
Car game
I had this idea to make a car game. As simple as to where you click a button it will move the cars to my position. To make one car go faster and one car go slower I made it so there was a transition. I’m not sure if it was the best idea. I’m on mobile right now and it’s giving me a syntax error and I’m not seeing where it is. https://code.sololearn.com/W524bj99j0Ak/?ref=app
15 ответов
+ 2
A JavaScript function is defined with the function keyword, followed by a name, followed by parentheses ().
function name() {
// code to be executed
}
+ 1
Have a look at the CSS animation properties
https://www.w3schools.com/css/css3_animations.asp
+ 1
https://code.sololearn.com/Wj7ipJv3NMm2/?ref=app
I want it to be kind of how sololearn did it. except the values random
+ 1
…
0
Thanks! Except now its giving me an error about my position.left = “50px”;
0
Why do you keep renaming your variables?
0
What do you mean?
0
Ahh i see
0
Okay so i fixed that. Only problem really is why my transition is not working.
0
What do you want the transition to do?
0
How do i make the boxes have speed. I waa thinking by adding transition they would move across.
0
randRed + "s"; is not a proper transition value
0
Okay, sorry that was a bad mistake. Anyhows how do i make the “cars” have speed so they dpnt just instantly go to they yellow line it actually yakes some time