Hello.
I am working on [URL=”http://html-js.comxa.com/TheBallGame.html”]a game
I made an object ([I]GameState
The problem is that I am not sure how I should make to draw the objects AND call their own specific and needed functions AND call other functions that don’t belongs to any object, in a good order.
Some objects have functions that update their position, check their position, draw them, draw other things that belong to them… Should it first draw, then check, then update? Not all objects have those methods, so it would get every object which came from a class with those functions then call them, but what if I want it to first draw, for example, a ball, then a rectangle, only then update the ball, then update the rectangle, then do all other things that belong to the ball…
Do you think it matters if it first draws everything, then updates/checks everything, or do every object at a time?
I don’t know if I really need to control the order those functions are called, or just make it with a way I wouldn’t have any order problems. This really confuses me a lot, because there are many different functions, so I would need to think in every order to know if it is the best.
Thanks for reading this and for some help ?