O'Reilly logo

Developing Games in Java™ by Bret Barker, David Brackeen, Laurence Vanhelsuwé

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required