Page 1 of 1

Fire mechanics

PostPosted: Tue Apr 24, 2012 6:31 pm
by vee41

I've been wondering what would be the best way to create rather simple fire spreading in my game. What I thought might be working approach is to create fire sprite that checks if it has any objects belonging to 'Burning' family near it. If anything 'burning' is within combustion range, it would create a new fire sprite on the 'burning' object.

After some quick tests though, it seems that family variables are actually FAMILY variables, not something that is inherited to members of the family? Like I had 'bool onFire' that triggered when the member of family was lit. It worked well once, but other objects would not combust as the 'onFire' of the family is true already.

What would be the most efficient way of doing something like this? Also, what would be best way to check for 'are there any burnable objects in combustion range'? Overlap on offset is a bit cumbersome for this.

Re: Fire mechanics

PostPosted: Tue Apr 24, 2012 7:44 pm
by R0J0hound
Family variables are inherited, if all the objects were changed to "onFire" then all of them were picked when "onFire" was set to True.

Here is an example:

Re: Fire mechanics

PostPosted: Tue Apr 24, 2012 7:47 pm
by vee41
Exactly what I was looking for thank you very much! Looks like I made few bad assumptions about instance selections, your example set me straight :)