diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2016-03-24 08:25:56 -0400 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2016-03-24 08:25:56 -0400 |
commit | c9bce16570160af24ae7f1f04249aa0e8313fb06 (patch) | |
tree | 1cf53f34ea6bfc17ee248faff8414712a3a19e9f /include | |
parent | 4e60d3e2d3f66471dff75732626451690a5bc8b5 (diff) |
Fire flickering
Diffstat (limited to 'include')
-rw-r--r-- | include/world.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/include/world.h b/include/world.h index 85b5370..51fbbfd 100644 --- a/include/world.h +++ b/include/world.h @@ -79,7 +79,8 @@ class World; * The light structure, used to store light coordinates and color. */ -typedef struct { +class Light{ +public: vec2 loc; /**< Light location */ Color color; /**< Light color */ float radius; /**< Light radius */ @@ -91,14 +92,26 @@ typedef struct { float fireFlicker; vec2 fireLoc; - // Light(vec2 l, Color c, float r){ - // loc = l; - // color = c; - // radius = r; - // belongsTo = false; - // following = nullptr; - // } -} Light; + Light(vec2 l, Color c, float r){ + loc = l; + color = c; + radius = r; + + belongsTo = false; + following = nullptr; + + flame = false; + } + + void makeFlame(void){ + flame = true; + } + + void follow(Entity *f){ + following=f; + belongsTo = true; + } +}; /** |