Chapter 14. Game Scripting
KEY TOPICS
Scripting Cookbook: What You Need
Implementing Touch and Release Notifications
Game Object Listeners
Scripting
Delayed Events
Putting It All Together
Enhancements
Summary
You walk into a dark room and flip a switch. A second later, a door opens across the way and light comes pouring in. But you don't get a chance to walk through the door—a couple of seconds later, the door slams shut and the room grows dark again. The trick? The door is only open for a few seconds, so you've got to flip the switch and run to get through the door.
How would you implement something like this in a game? That's what you'll solve in this chapter.
Every level in a typical game has a certain amount of unique code for environment interaction, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access