Fire mechanics

0 favourites
  • 3 posts
From the Asset Store
Top down zombie survival mechanics pack in the style of Cannon Fodder.
  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • 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 :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)