Pong in javascript [Solve] | Sololearn: Learn to code for FREE!


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

3/15/2020 9:10:36 PM


5 Answers

New Answer


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).


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.


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.


sorry velocidad2 is equal to 100 and it is call in the keyCode 67 in a Switch loop


In the sololearn playground there are things that don’t work but in a real IDE with google works