28.04.2019 Views

[JAVA][Beginning Java 8 Games Development]

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

■ Contents<br />

Organizing the .update( ) Method: .moveInvinciBagel( )265<br />

Further Modularization of the .update( ) Method: .setXYLocation( ) 266<br />

Setting Screen Boundaries: .setBoundaries( ) Method267<br />

Testing the InvinciBagel Sprite Boundaries: Run ➤ Project 270<br />

Summary270<br />

■■Chapter 13: Animating Your Action Figure States: Setting the Image<br />

States Based on KeyEvent Processing273<br />

InvinciBagel Animation: The .setImageState( ) Method274<br />

The InvinciBagel Wait State: If No Key Pressed Set imageState(0) 274<br />

The InvinciBagel Run State: If KeyPressed Set imageState(1 & 2) 276<br />

The InvinciBagel Fly State: If KeyPressed Set imageState(3 & 4) 277<br />

Mirroring Sprites: Quadrupling Your Image Assets from 9 to 36 278<br />

Animating Your Run Cycle: Creating a Nested If-Else Structure 279<br />

Coding Your Run Cycle Throttle: Triple Nested If-Else Structures 283<br />

Adding Event Handling: Giving ASDW Keys Function289<br />

Creating ASDW Key Get and Set Methods: NetBeans Insert Code 291<br />

Adding Jump and Evade Animation: Using the W and S Keys 293<br />

Last Minute Details: Setting the isFlipH Property294<br />

Testing the InvinciBagel Sprite Animation States: Run ➤ Project 295<br />

Summary298<br />

■■Chapter 14: Setting Up the Game Environment: Creating Fixed Sprite<br />

Classes Using the Actor Superclass299<br />

Creating the Prop.java Class: Extending Actor.java300<br />

Mirrored Prop Classes: Set the isFlip Property in the Constructor 304<br />

Using the Prop Class: Creating Fixed Scene Objects310<br />

Adding Prop and Image Declarations: Prop and Image Objects 310<br />

Instantiate Image Objects: Using the .loadImageAssets( ) Method 312<br />

Adding Fixed Sprites Using Prop Objects: .addGameActors( ) 312<br />

Using Larger Scene Props: Compositing with <strong>Java</strong>FX317<br />

Summary320<br />

xiv<br />

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!