A
A
Artur Kudashev2019-03-23 19:05:00
JavaScript
Artur Kudashev, 2019-03-23 19:05:00

How to make a game right?

Hello, I'm making a clone of the Color Switch game. Almost everything is ready, but I can not do the most important thing, and this is the fall of the ball.
5c9658199d69a001031133.png
I wanted to make the top of the ball increase every millisecond and compare the coordinate of the bottom of the ball with the coordinate of the top of the circle, but it seems to me that this will load the computer. How to implement my idea? If there is another solution I will be glad.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hzzzzl, 2019-03-23
@hzzzzl

first try the simplest option "on the forehead" "so that the top of the ball increases every millisecond and compare the coordinate of the bottom of the ball with the coordinate of the top of the circle", do not underestimate the resources of the computer :) in the browser (and in general in the operating system) behind the scenes a lot of things happen like this and so,
but is it really necessary for react, or just to play around?
https://developer.mozilla.org/en-US/docs/Web/API/w...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question