Info

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

Statistics

  • Download count1,126 total downloads
  • Latest download count 1,083 downloads of latest version
  • Average download count1 downloads per day average

Owners

Description

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

Example Files

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

Discussion

  • 15 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • Hello! can anybody tell me why does preview will not come if i insert the else condition in the event? please guide me as soon as possible.

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