int tempDirToucherMain(int argc, char *argv[]) { initialize(argc, argv, 2); installSignalHandlers(); maybeDaemonize(); maybeWritePidfile(); while (1) { if (dirExists(dir)) { DEBUG("Touching directory"); touchDir(dir); if (!doSleep(sleepInterval)) { break; } } else { DEBUG("Directory no longer exists, exiting"); break; } } maybeDeletePidFile(); if (shouldCleanup) { DEBUG("Cleaning up directory"); performCleanup(dir); } return 0; }
int main(int argc, char *argv[]) { initialize(argc, argv); installSignalHandlers(); maybeDaemonize(); maybeWritePidfile(); while (1) { if (dirExists(dir)) { touchDir(dir); if (!doSleep(1800)) { break; } } else { break; } } maybeDeletePidFile(); if (shouldCleanup) { performCleanup(dir); } return 0; }
void playerHurts(GameObject entity) { /* Si le timer d'invincibilité est à 0, on perd un coeur */ if(player.invincibleTimer == 0 && !player.touch) { player.life--; player.invincibleTimer = 10; player.touch = 1; touchDir(player.direction, &player, entity); playSoundFx(DESTROY); } }