From c9bce16570160af24ae7f1f04249aa0e8313fb06 Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Thu, 24 Mar 2016 08:25:56 -0400 Subject: Fire flickering --- include/world.h | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'include') 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; + } +}; /** -- cgit v1.2.3