Description

Allows you send an event from one event sheet to one or more event sheets.

Example Files

EventTriggerTest.c3p (167 KB)

Note: Updated for version 1.2.0 - This example shows how an included event in two other layout event sheets, can send an event and the current layout will handle the message and respond differently.N

Version History

Version Size Downloads Released
1.3.0 (Current)
Stable
49 KB 79 Download

Share

Download

1.3.0 Stable (49 KB)

Info

  • License MIT License
  • Copyright Robert Greenberg. All rights reserved.

Statistics

  • Download count 122 total downloads
  • Latest download count 79 downloads of latest version
  • Average download count 2 downloads per day average

Owners

Tags

  • 14 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • Tried it out in the last Ludum Dare! Liked it a lot, it's a nice way to order code :) My entry with source code is over here: alcex.itch.io/tetromino-ghost-smasher

  • What's different from function?

    • Actually typing the response to your question made me think through a scenario that made me realize that there is a bug in the code. If you only send one event, but there are multiple handlers waiting to respond, only one will trigger. I am working on that and will issue a new version soon.

    • That's a great question.

      1) It decouples your code so you fire off an event and aren't concerned who or if anyone handles it.

      2) Based on the event sent, you could have different logic executed on different event sheets. So lets say you have a player being hit by bullets. The player event sheet sends an event player hit, It's responsibility is all things about the player. The title screen may act on that message by changing the color of player. On the game screen it may decrease the health of the player.

      3) You also could have multiple items respond differently based on the event. Lets say you emit an event for player health low. You could have a health bar that listens for that event and changes color, the player could listen for that event and start flashing, etc.

      So it's a different way of organizing and thinking about your code in a more event system driven way where one event could have a multitude of results.

      Hope this helps

      • Doesn't this work with only the Function object?

        Call the Function "Screen Touch" (from your blog post), and in this function call other functions or other code

        Load more comments (5 replies)
      • Ok, I kind of understand now:

        1.It's for keeping code split and orgnazied. I do have player code in enemy event sheet.

        2.It's a broadcast and there is no broadcast for function plugin.

        One thinking : Compare to function, this event have only 1 parameter, it has more work to do if I want to picking object with messages.

        Load more comments (2 replies)