Differences

This shows you the differences between two versions of the page.

documentation:entitysystem [2011/05/10 08:41]
armageddon
documentation:entitysystem [2011/05/10 08:45] (current)
armageddon [Thinking]
Line 44: Line 44:
 ===== Thinking ===== ===== Thinking =====
  
-Every entity has a think-function that is called every frame. There it can do calculations, change its position and the like. To make this possible, the EntityManager, whose think-function is called every frame by the main class, has to "think" all the entities:+Every entity has a think-function that is called every frame. There it can do calculations, change its position and the like. To make this possible, the EntityManager (serverside and clientside), whose think-function is called by the main class every frame, has to "think" all the entities:
  
 <code java> <code java>
Line 78: Line 78:
 </code> </code>
  
-Since an entity can not modify the global list of entities while it is beeing looped through (for example in its think function), adding and removing entities has to be handled by add- and remove-lists. The spawn- and remove- functions add the respective command to a list, which is then processed **after** all entities have been thinked. +Since an entity can not modify the global list of entities while it is beeing looped through (for example in its think function), adding and removing entities has to be handled by add- and remove-lists. The spawn- and remove- functions add the respective command to a list, which is then processed **after** all entities have been thinked. This is only true for the Server, since the client should never add an entity by itself anyways
  
  
 
 documentation/entitysystem.txt · Last modified: 2011/05/10 08:45 by armageddon
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Driven by DokuWiki