#ifndef GAMEOBJECT_H #define GAMEOBJECT_H #include "renderer.h" #include "vecmath.h" typedef enum { PLAYER = 0, COIN, ALIEN, APPLE, HEART} object_type; typedef enum { LIVE = 0, TERMINATING, DEAD} status_type; typedef enum { EXPLODES = 0, DISAPPEARS, } coll_type; typedef enum { COLLIDES_ON_TERMINATING=1, GIVES_PICK_POINTS=2, GIVES_KILL_POINTS=4, RECEIVES_SCORE=8, LETHAL_ON_HIT=16, COLLIDABLE = 32 } prop_type; // properties (characteristics) typedef struct { float radius; vec2f center; } Circle; typedef struct tGameObject{ object_type type; GfxObject gfxObj; vec2f pos; float speed; double angle, angleSpeed; float scale, scaleSpeed; // new members for animated images: float frame; float frameSpeed; int numFrames; // others status_type status; prop_type props; coll_type onCollision; // other type-specific members int score; // for objects who receives points int points; // how many points the object is worth picking/shooting int health; // methods: void (*update) (struct tGameObject* gameobj); void (*render) (struct tGameObject* gameobj); } GameObject; void render(GameObject* this); // metod extern GameObject* gameObjects[]; extern int nGameObjects; void renderAllGameObjects(); void updateAllGameObjects(); void collisionDetection(); void removeDeadObjects(); #endif // GAMEOBJECT_H