O'Reilly logo

Beginning Java 8 Games Development by Wallace Jackson

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 12

image

Setting Boundaries for Your Action Figure in 2D: Using the Node Class LocalToParent Attribute

Now that we have organized your Java code into logical methods in the InvinciBagel.java class, and wired up the GamePlayLoop .handle() method to the Bagel .update() method in Chapter 10, to make sure that our KeyEvent handlers will move our InvinciBagel character around the screen, it is time to establish some boundaries for our game hero, so that he does not leave the field of play, so to speak. To do this, we will need to dive into the JavaFX Node superclass at a much deeper level of detail then we did in Chapter 4. We will look at how

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