100% developed

Guide to Game Development/Theory/Game logic/Activating the entities' tick and render functions

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Note: This code uses Entity and how you can set up your tick and render functions.

Main.cpp:

vector<Entity> objects; //This array could be a list. The contents of this will keep being added to, and removed from over time.
void Tick(){
    for (Entity E: objects)
        E.Tick();
}

void Render(){
    for (Entity E: objects)
        E.Render();
}