Fire mechanics

Get help using Construct 2

Post » Tue Apr 24, 2012 6:31 pm

Heya,

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.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Tue Apr 24, 2012 7:44 pm

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:
http://dl.dropbox.com/u/5426011/examples10/fire.capx
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Tue Apr 24, 2012 7:47 pm

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 :)
B
24
S
8
G
7
Posts: 756
Reputation: 7,192


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests