diff --git a/client/src/render/render.c b/client/src/render/render.c index 7fc2181..8212f74 100644 --- a/client/src/render/render.c +++ b/client/src/render/render.c @@ -6,6 +6,8 @@ void render_world(struct world_t const *world) { + printf("%zu %zu\n", world->height, world->width); + for (size_t i = 0; i < MAX_ENTITIES; i++) { struct entity_t const *const entity = &world->entities[i]; struct entity_registrant_t const *const registrant = diff --git a/server/src/main.c b/server/src/main.c index db985ba..94894e2 100644 --- a/server/src/main.c +++ b/server/src/main.c @@ -28,9 +28,19 @@ static enum error_t simulation_thread_body(struct game_data_t *data) { assert(data != NULL); // TODO: An actual game loop lol - printf("Hello, world!\n"); + while (true) { + if (pthread_mutex_lock(&data->world_lock) != 0) goto error; + data->world.width = (data->world.width + 1) % 100; + data->world.height = (data->world.height + 1) % 100; + if (pthread_mutex_unlock(&data->world_lock) != 0) goto error; + + sleep(1); + } return ERR_OK; + +error: + return ERR_MUTEX; }