28.04.2019 Views

[JAVA][Beginning Java 8 Games Development]

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

■ Contents<br />

Creating a Hero Superclass: Motion Actor Attributes177<br />

Adding Update and Collision Methods: .update( ) and .collide( ) 178<br />

Adding Sprite Control and Definition Variables to the Hero Class 179<br />

Accessing Hero Variables: Creating Getter and Setter Methods 182<br />

Updating the Game Design: How Actor or Hero Fit In185<br />

Summary186<br />

■■Chapter 9: Controlling Your Action Figure: Implementing <strong>Java</strong> Event Handlers<br />

and Using Lambda Expressions187<br />

Game Surface Design: Adding Resolution Flexibility188<br />

Finishing the UI Design: Coding a Game Play Button189<br />

Testing the Game Play Button: Making Sure Your Code Works 190<br />

Upgrading the Other UI Button Code: Making ImageView Visible 190<br />

Lambda Expression: A Powerful New <strong>Java</strong> 8 Feature191<br />

Handling NetBeans Unexpected Updates and Incorrect Warnings 194<br />

Event Handling: Adding Interactivity to Your <strong>Games</strong>195<br />

Types of Controllers: What Types of Events Should We Handle? 195<br />

<strong>Java</strong> 8 and <strong>Java</strong>FX Events: javafx.event and java.util196<br />

<strong>Java</strong>FX Input Event Classes: The javafx.scene.input Package 196<br />

Adding Keyboard Event Handling: Using KeyEvents199<br />

Processing Your KeyEvent: Using the Switch-Case Statement 200<br />

Creating the KeyPressed KeyEvent Handling Structure 202<br />

Adding Alternate KeyEvent Mapping: Using A-S-D-W204<br />

Updating Our Game Design: Adding Event Handling205<br />

Summary206<br />

■■Chapter 10: Directing the Cast of Actors: Creating a Casting Director Engine<br />

and Creating the Bagel Actor Class207<br />

Game Design: Adding Our CastingDirector.java class208<br />

List and ArrayList: Using java.util List Management208<br />

The <strong>Java</strong> Interface: Defining Rules for Implementing Your Class 209<br />

The List Public Interface: A List Collection of <strong>Java</strong> Objects 210<br />

xii<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!