void System::tick(EntityService *es, float dt) { for (EntityID e = 0; e < MAX_ENTITIES; ++e) { if ((es->getComponentMask(e) & mask) == mask) tickEntity(es, e, dt); } }
void gameUpdate(){ if(controlledEntity != NULL) controlEntity(); tickBullets(); for(pent c = worldEntities; c != NULL; c = c->next){ tickEntity(c); tickAI(c); tickWallCheck(c); } }
void tick() { if (player.p.isDead) { if (player.p.endTimer < 1) { currentMenu = MENU_LOSE; } --player.p.endTimer; return; } else if (player.p.hasWon) { if (player.p.endTimer < 1) { currentMenu = MENU_WIN; } --player.p.endTimer; return; } tickTouchMap(); int i; for (i = 0; i < 324; ++i) { int xx = rand() & 127; int yy = rand() & 127; tickTile(xx, yy); } tickPlayer(); xscr = player.x - 100; yscr = player.y - 56; if (xscr < 16) xscr = 16; else if (xscr > 1832) xscr = 1832; if (yscr < 16) yscr = 16; else if (yscr > 1912) yscr = 1912; for (i = 0; i < eManager.lastSlot[currentLevel]; ++i) { Entity * e = &eManager.entities[currentLevel][i]; if ((e->type != ENTITY_ZOMBIE && e->type != ENTITY_SLIME) || (e->x > player.x - 160 && e->y > player.y - 125 && e->x < player.x + 160 && e->y < player.y + 125)) tickEntity(e); } }