/* * Update all scene animations, calc positions and so on */ void scene::update(void) { update_animations(); update_hierarchy(); update_renderlist(); update_box(); }
void handler() { process_keys(); update_projectiles(); update_animations(); step_monsters(); game.player.light->update_flicker(); process_sight(); draw_lights(game.fov_light, &game.map.block, game.map.lights); { lightsource *k = game.map.lights.head(); for (; k; k = k->next()) { k->update_flicker(); draw_light(game.fov_light, &game.map.block, k); } } u32 keys = keysHeld(); u32 down = keysDown(); touchPosition touch = touchReadXY(); if (down & KEY_TOUCH && keys & KEY_R && touch.px != 0 && touch.py != 0) { luxel *l = torch.buf.luxat(torch.buf.scroll.x + touch.px/8, torch.buf.scroll.y + touch.py/8); iprintf("c:%d,%d,%d v:%d, low:%d\n", l->lr, l->lg, l->lb, l->lval, torch.get_low_luminance()); } refresh(&game.map.block); if (game.player.hp <= 0) { playerdeath(); game.player.clear(); new_game(); } if (game.cooldown <= 0) game.player.regenerate(); statusbar(); }