c# - Developing Games - How are things that take more than one game loop performed? -


I am using C #, but it is applicable to developing any game in any language.

Most games use 'Game Loop', which will look something like this:

  while (the game is playing) {UpdateEnvironment (); DrawEnvironment (); }  

I am struggling to understand what will fit into more than one game loop equation. For example, making a float ball from one tile with one tile or a player to take a tile (not to jump on the tile from the tile but rather to animate it).

The best part is that I have passed the time since the last loop, object / method, so it can talk about it but it does have difficulty in doing things like:

  A.M.Howo (10, 20); // Pathfind, then follow the path of this tile. Player.Shoot (); // Shoot one, and explore and update the collision along the way.  

Where can I find more information about the events that perform more than one game loop?

One way to do this is to collect the entire pending work and then the game loop only performs a little bit of it Does. Action objects referenced by action they know the state, so it is known to perform the next bit. While still something has been left to do, the action is added to the line of pending tasks in the next loop, and when the task is completed, it will not be added back again.

Therefore, in your MoveTo example, the operation of the operation runs on 10, 20 and every time in the game loop, AI < / Code> is transferred one bit on your side, it's better to describe your shoot example as a bullet traveling in a particular direction, and then whatever hit hits Determines if the action is ongoing or not.

I have not done sports development, so I do not know whether it has been done in that area, but it is a way on which I will do this in an incident-based system.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -