Properly kill gameobjects, sprites, physics shapes

This commit is contained in:
2023-01-13 14:05:36 +00:00
parent e0b7d6459d
commit d2cbc61164
10 changed files with 116 additions and 81 deletions

View File

@@ -24,10 +24,8 @@ struct editor {
};
struct gameobject {
union {
cpBodyType bodytype;
struct gameobject *next;
};
cpBodyType bodytype;
int next;
float scale;
float mass;
float f; /* friction */
@@ -44,6 +42,7 @@ extern struct gameobject *gameobjects;
int MakeGameobject();
void gameobject_apply(struct gameobject *go);
void gameobject_delete(int id);
void gameobjects_cleanup();
void toggleprefab(struct gameobject *go);
struct gameobject *get_gameobject_from_id(int id);