E
E
essenay2020-07-07 13:34:43
Canvas
essenay, 2020-07-07 13:34:43

How to implement the functionality of the game?

The essence of the game, without hitting the walls, drag the circle to the finish line. How to implement? Maybe there are articles on this?5f044fa574425121146416.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dima Polos, 2020-07-07
@essenay

Only logic and hard code. If there are articles and lessons for all games and programs, the cost of development and the salary of a programmer will be slightly higher than a cashier in a supermarket.
UPD: for drawing, you take a canvas, so that the game works, you need to run a loop or recursion that will draw on the canvas, for this, use requestAnimationFrame (in this case, recursion). For the logic of the game - it is necessary to change the coordinates of the object during the user's action - consider its intersection with other objects (a ball with a wall, for example) - draw it, and then decide whether to continue the game or not, this may require several flags. The flag is a boolean variable, depending on which the code will either continue or not, for example isFailed = false... and check somewhere: if( !isFailed )... the game is on. Good luck!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question