You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
753 B
Objective-C

#include <stdio.h>
#include <raylib.h>
#include <stdbool.h>
#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();
}
}