+ 1
Pong in javascript [Solve]
Hi everyone, can you all try to help me pls. I'm trying to code the classic game pong but i don't know how to code the ball. My oll code(In another IDE the functions moveTopJ1, moveBottomJ1, moveTopJ2, moveBottomJ2 works): https://code.sololearn.com/Wf5BpOL5z92z/#html
5 Antworten
+ 5
AlexRos Share the code. It doesn't matter if it doesn't work here. We need more info.
Your loop variable is always 1(infinite loop).
+ 3
I am not familiar with js but as far as I can see moveBall is a function. So I guess you need to call this function.
Btw: what is velocidad2? I can't see that you define this variable.
+ 3
And where do you define ball?
Maybe it is better to add your complete code in code playground (webcode -> js) and to share the link here.
+ 1
sorry velocidad2 is equal to 100 and it is call in the keyCode 67 in a Switch loop
+ 1
In the sololearn playground there are things that don’t work but in a real IDE with google works