Answer the question
In order to leave comments, you need to log in
How to control the speed and size of the ball?
How can I make it possible to set the speed of the ball when pressing the keys from 1 to 9, when pressing the C key, the ball decreases, and when the V key is pressed, it increases?
https://jsfiddle.net/afcphohn/
Answer the question
In order to leave comments, you need to log in
Hmm, I can see from the code that you missed all my recommendations. This is how you need to more or less implement such games. ( CODE ). True, I got a little carried away and did too much.
Look here. You have written a canvas of code. Was it really so difficult to make an example on jsBin or jsFiddle so that we can immediately see exactly how the ball moves, and what kind of ball is it? Of course, you can understand your code, you can upload it somewhere yourself, but hardly anyone will do it. Please use sandboxes for tasks with more than three lines of code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question