万本电子书0元读

万本电子书0元读

顶部广告

Haxe Game Development Essentials电子书

售       价:¥

3人正在读 | 0人评论 9.8

作       者:Jeremy McCurdy

出  版  社:Packt Publishing

出版时间:2015-11-26

字       数:119.7万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Create games on multiple platforms from a single codebase using Haxe and the HaxeFlixel engine About This Book Learn the modern, cross-platform language Haxe to build games without any trouble Create engaging 2D games that are compatible with desktop, web, and mobile platforms Learn how to speed up your workflow with OpenFL and HaxeFlixel using this useful and compact guide Who This Book Is For This book is for game developers with some experience programming games on one or more platforms already. If you want to leverage your game development experience on one platform to develop for multiple platforms and to get up and running quickly, this book is for you. Having prior experience with a language similar to Haxe, such as ActionScript or JavaScript will help, but isn't required. What You Will Learn Understand the fundamentals of the Haxe programming language Set up a development environment that will work on Windows, Mac, and Linux Create fun 2D games using OpenFL and HaxeFlixel Understand how to implement a user interface Enhance the gameplay experience with cool animations Improve immersion by adding sound Make your game modular and easily expandable using configuration files Compile games that will work on desktop, web, and mobile platforms In Detail Haxe is a powerful and high-level multi-platform language that's incredibly easy to learn. Used by thousands of developers and many high-profile companies, Haxe is quickly emerging as a forerunner in the area of cross-platform programming. OpenFL builds on top of Haxe to make developing for multiple platforms quick and painless. HaxeFlixel provides you with the tools you need to build amazing 2D games easier than ever before. Cross-platform development has been supercharged using the Haxe programming language, making it increasingly easy and hassle-free to develop multi-platform games. If you've programmed games before and want to learn out how to deliver games across multiple platforms, or develop games faster, then Haxe Game Development Essentials is the book for you. It starts by showing you how to set up your development environment, then running you through some Haxe language fundamentals, and finally taking you through the process of programming a game from start to finish. You will learn how to create a side scrolling shooter game using HaxeFlixel. Next you will learn to enhance the game with new gameplay features, user interfaces, animations, sound, and configuration files to make your game expandable. Once your game is built and ready, you will learn how to deploy it to web, Android, iOS, and desktop systems. By the end of this book, you will be confident about creating multi-platform games using Haxe, OpenFL, and HaxeFlixel in a faster and easier way. Style and approach Since this book is aimed at people who have worked on games before, this book is written in a way that will get you quickly up to speed with a new set of tools, but will still be accessible for less experienced developers. Each chapter covers an essential milestone in building a game from start to finish. The chapters move in a logical fashion, starting with the basics of Haxe development and ending with preparing a game for deployment.
目录展开

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

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部