Refactor into more modular architecture
This commit is contained in:
27
asteroids.h
Normal file
27
asteroids.h
Normal 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
|
||||
Reference in New Issue
Block a user