#include #include #include #include "timer.h" int main(void) { Timer *t = [[Timer alloc] init]; char buffer[100]; InitWindow(400, 400, "ghost"); SetTargetFPS(60); Color theColor = BLACK; [t start]; while (!WindowShouldClose()) { if (IsKeyPressed(KEY_SPACE)) { if (t->paused) { [t resume]; theColor = BLACK; } else { theColor = RED; [t pause]; } } [t tick]; BeginDrawing(); ClearBackground(WHITE); DrawText([t timeString], 400/2 - 50, 400/2 - 50, 100, theColor); EndDrawing(); } }