售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Haxe Game Development Essentials
Table of Contents
Haxe Game Development Essentials
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started
What's Haxe?
OpenFL
HaxeFlixel
Installation
Installing Haxe
OpenFL
Setting up an IDE
Installing HaxeFlixel
Setting up target platforms
Flash
Android
iOS
Desktop
Hello World
Creating a project
Running the project
Copying assets
Making changes
Summary
2. Building a New Game
The Haxe syntax
Data types and structures
Operators
Access modifiers
Variables
Functions
The for loops
Classes
Setting up a new HaxeFlixel project
Creating the new project
The anatomy of our project
Changing settings
Adding assets
Adding a background and basic UI
Making enemies
Creating the enemy class
Adding variables
Setting up the display
Creating the spawn timer
Instantiating enemies and adding interaction
Adding new imports
Adding variables
Creating instances and adding mouse events
Creating the end screen
Creating the end screen class
Adding variables
Adding the background and score text
Restarting the level
Implementing the game timer
Importing the end screen
Adding variables
Creating the level timer
Creating the timer callback function
Summary
3. Dealing with Menus and Screen Flow
Adding new assets
Changing the default state
Building the splash screen
Adding imports
Creating variables
Adding sprites
Adding instructions
Starting the animation sequence
Creating the next stage of the sequence
Finishing the sequence
Navigating back to the game
Updating the level end screen
Adding imports
Adding variables
Housekeeping
Adding the group and setting up the window
Adding scores
Adding the play again button
Showing the best score sprite
Creating the animation sequence
Creating the new game HUD
Creating the GameHUD class
Adding imports
Adding variables
Laying things out
Changing the score
Adding the new game HUD
Adding imports
Adding variables
Housekeeping
Adding the HUD and enemy group
Summary
4. Delving into Animations and Gameplay
Object pooling
Project updates
Adding new assets
Updating the project settings
Creating the explosion effects
Creating the class
Adding imports
Creating variables
Setting up Texture Packer data
Adding sprites
Creating a particle emitter
Adding everything to the group
Starting the explosion sequence
Showing the explosion bulb
Showing smoke and completing the animation
Preparing for object pooling
Making muzzle flashes
Creating the class
Adding imports
Creating variables
Adding sprites
Playing the flash
Showing the rings
Updating enemies
Adding imports
Adding variables
Adding animation
Resetting the spawn position
Updating the onSpawn function
Adding death functionality
Creating projectiles
Creating the class
Adding imports
Creating variables
Displaying the sprite and setting the velocity
Making the player character
Creating the class
Adding imports
Creating variables
Adding animation
Making the projectile pool
Creating the muzzle flash
Starting the shoot timer
Shooting projectiles
Handling player input
Building movement functions
Handling player death
Setting health on the HUD
Changing hearts
Adding everything to PlayState
Adding imports
Adding variables
Cleaning things up
Adding the scrolling backdrop
Creating and adding the player
Creating an explosion object pool
Killing enemies
Updating the score
Detecting collisions
Handling collisions between projectiles and enemies
Handling collisions between the player and enemies
Summary
5. Adding Sound
Project updates
Adding new assets
Updating the project settings
Creating sound constants
Creating the class
Creating sound ID constants
Creating volume constants
Building the sound manager class
Creating the class
Adding imports
Implementing the singleton pattern
Adding music
Creating playback functions
Calling playback functions
Adding menu sounds
Creating playback functions
Calling playback functions
Adding gameplay sounds
Creating variables
Creating functions
Calling playback functions
Summary
6. Working with Configuration Files
JSON versus XML
Project updates
Adding new assets
Understanding the JSON configuration file
A simple example
Looking at the JSON format
Building the enemy spawner
Creating the enemy spawner class
Adding imports
Adding variables
Parsing JSON data
Populating the pool
Spawning enemies
Adding movement patterns to enemies
Adding imports
Adding variables
Removing old functionality
Creating the startPattern function
Updating onSpawn and resetSpawn
Updating PlayState
Removing old functionality
Using EnemySpawner
Understanding the XML file
Looking at the file's contents
Pulling string data from XML
Building the Strings class
Handling XML data
Building the StringIDs class
Replacing strings
Updating MenuState
Updating GameHUD
Updating LevelEndScreen
Summary
7. Deploying to Multiple Platforms
Building for Flash
Deploying to the Web
Building for Windows
Building for OS X
Building for Android
Building for iOS
Xcode setup
Setting up a certificate
Setting up an App ID
Registering a device
Creating a provisioning profile
Running the game on iOS
Summary
8. What's Next?
Expanding the game
Level-based gameplay
Power-ups and collectibles
More enemies and bosses
Exploring advanced features
Gamepads
Physics
Tilemaps
Continuing on with learning resources
Haxe
OpenFl
HaxeFlixel
Community resources
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜