Any complex include sheet examples?

0 favourites
  • 10 posts
From the Asset Store
- This pack is suitable for shooting games, running games, platform games, and side-scrolling...
  • To learn from

    thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • NOt sure exactly what you are looking for? Including the sheets isn't complex, are you just looking for sheets with complex logic? I tend to put sheets together for specific things like a sheet on the characters movement, etc... and then include it on all layouts as the player controls the same on all of them...

  • Hi Phaze, something like:

    creating sprite particles

    or

    calling arrays

    I saw that including "CodeSheet" in another sheet automatically executes anything inside them, but I'd like to know how to call code from CodeSheet, that is, how to reuse code inside a current Layout sheet, like

    current sheet: GameSheet

    Event: On destroy: Create particles (call code stored in CodeSheet)

    hope I explained myself.

  • Hi Phaze, something like:

    creating sprite particles

    or

    calling arrays

    I saw that including "CodeSheet" in another sheet automatically executes anything inside them, but I'd like to know how to call code from CodeSheet, that is, how to reuse code inside a current Layout sheet, like

    current sheet: GameSheet

    Event: On destroy: Create particles (call code stored in CodeSheet)

    hope I explained myself.

    If you've included the sheet which holds the event you wish to run, you don't really need to 'call' it in any manner. What including an event sheet to another does, it basically pastes all it's content to the other event sheet.

    So in your example, if you included an event sheet with trigger : On particle created, it would trigger when the destroy event in your other event sheets runs and creates particles.

  • It sounds like what you are wanting is Functions. You can call a function to repeat a series of events each time it's called with different parameters.

    The manual: https://www.scirra.com/manual/149/function

    Including event sheets is actually combining them, Construct2 consideres them as all one event sheet. (Except that the included sheets "On Start" events will fire first.)

    Edit: Yann is making Videos, and goes over functions in this one. He offers lots of tips for their use.

    Edit again, just noticed my link to the maual had a space after it that prevented it working, so it's fixed now.

  • > Hi Phaze, something like:

    >

    > creating sprite particles

    > or

    > calling arrays

    >

    > I saw that including "CodeSheet" in another sheet automatically executes anything inside them, but I'd like to know how to call code from CodeSheet, that is, how to reuse code inside a current Layout sheet, like

    >

    > current sheet: GameSheet

    > Event: On destroy: Create particles (call code stored in CodeSheet)

    >

    > hope I explained myself.

    >

    If you've included the sheet which holds the event you wish to run, you don't really need to 'call' it in any manner. What including an event sheet to another does, it basically pastes all it's content to the other event sheet.

    So in your example, if you included an event sheet with trigger : On particle created, it would trigger when the destroy event in your other event sheets runs and creates particles.

    so you're saying, if I have

    spriteDude

    and includedCodeSheet has

    spriteDude on click: destroy

    spriteDude on click: spawn dust particles

    that will work?

    <img src="smileys/smiley3.gif" border="0" align="middle" />

  • thanks paradox too!

  • if I have

    spriteDude

    and includedCodeSheet has

    spriteDude on click: destroy

    spriteDude on click: spawn dust particles

    that will work?

    <img src="smileys/smiley3.gif" border="0" align="middle" />

    Yes man

  • mucho thanks!

  • It sounds like what you are wanting is Functions. You can call a function to repeat a series of events each time it's called with different parameters.

    The manual: https://www.scirra.com/manual/149/function

    Including event sheets is actually combining them, Construct2 consideres them as all one event sheet. (Except that the included sheets "On Start" events will fire first.)

    Edit: Yann is making Videos, and goes over functions in this one. He offers lots of tips for their use.

    I needed functions, thanks Paradox

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