Chapter 3: Event-Based Programming
In this chapter, we will learn about a specific way of programming, called event-based programming. Event-based programming allows us to write more optimized code. That is because our code will only run when a particular event happens. If this event does not happen, our code will not run. We will start by looking at functions that we can execute on instances instead of within scripts. After that, we will start listening to events. Once we know how to do this, we will make our own events. Then, we will learn how to use bindable events and bindable functions to do this. Finally, we will compare these custom events to modules, and we will even learn how to combine them.
The following topics will be covered in this chapter:
- Introduction to events
- Creating custom events
- Exercise 3.1 – event-based game
By the end of this chapter, you will understand the fundamentals of event-based programming. You will be able to use functions...