Refactor into more modular architecture

This commit is contained in:
Camden Dixie O'Brien
2025-10-17 14:03:34 +01:00
parent 34e32c6a46
commit 536ee74b61
12 changed files with 813 additions and 428 deletions

27
asteroids.h Normal file
View File

@@ -0,0 +1,27 @@
#ifndef ASTEROIDS_H
#define ASTEROIDS_H
#include "physics.h"
typedef void (*asteroids_cb_t)();
typedef enum {
ASTEROID_SMALL,
ASTEROID_MEDIUM,
ASTEROID_LARGE,
ASTEROID_HUGE,
} asteroid_size_t;
typedef struct {
float probability;
asteroid_size_t size;
} asteroid_size_dist_entry_t;
void asteroids_clear();
void asteroids_on_clear(asteroids_cb_t cb);
void asteroids_add(const asteroid_size_dist_entry_t *dist);
void asteroids_hit(unsigned shot, unsigned asteroid, physics_sep_t sep);
bool asteroids_check(unsigned id);
#endif