Simplifying my code

0 favourites
  • 5 posts
From the Asset Store
5 levels with simple coding Source-code (.c3p) + HTML5 Exported
  • Hi All

    I would like to simplify this code, so as I increase the number of instances of the BuildingFamily I don't have to keep adding additional code. I know there is probably a really easy way to do this, but I keep going around in circles.

    A quick summary of what it does.

    As the player nears a building, the facade fades to reveal the inside.

    <img src="http://www.howardfrancisdavies.co.uk/problem.png" border="0" />

    I would be greateful for some help.

    Cheers

    Howard

  • +System: TowerSmall.X-Basket.X <= 300
    +BuildingFamily: Number = TowerSmall.Number
      -> BuildingFamily: Fade: start fade

    Maybe...

  • Hey thanks Yann for the reply, but sadly no joy <img src="smileys/smiley6.gif" border="0" align="middle" />

    I tried a whole bunch of iterations of that and it only seems to work if I specify each one individually (see top).

  • This should behave the same as your events:

    +for each BuildingFamily
    +System: TowerSmall.X-Basket.X <= 300
    +BuildingFamily: Number = TowerSmall.Number
      -> BuildingFamily: Fade: start fade

    The "for each" would not be needed if there was only one instance of TowerSmall.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's it! <img src="smileys/smiley32.gif" border="0" align="middle" /> Thanks guys, working perfectly now.

    I can apply that to a lot more of my events too!

    Cheers

    Howard

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