Developing games that can reach a wide audience can often be a serious challenge. A big part of the problem is figuring out how to make a game that will work on a wide range of hardware and operating systems. This is where Haxe comes in.
Over the course of this book, we'll look at getting started with Haxe and the HaxeFlixel game engine, build a side-scrolling shooter game that covers the core features you need to know, and prepare the game for deployment to multiple platforms.
After completing this book, you will have the skills you need to start producing your own cross-platform Haxe-driven games!
Chapter 1, Getting Started, explains setting up the Haxe and HaxeFlixel development environment and doing a quick Hello World example to ensure that everything is working.
Chapter 2, Building a New Game, looks at the fundamentals of the Haxe language and building the core foundation of our game.
Chapter 3, Dealing with Menus and Screen Flow, helps to set up our game's UI, add simple UI animations, and control the flow between screens.
Chapter 4, Delving into Animations and Gameplay, explains adding sprites and scripted animations and adding the bulk of our gameplay functionality.
Chapter 5, Adding Sound, delves into the aspects of adding music and sound effects to make our animations and gameplay truly engaging.
Chapter 6, Working with Configuration Files, talks of using JSON and XML configuration files to make our game expandable and editing the text far easier.
Chapter 7, Deploying to Multiple Platforms, shows how to take our completed game and build it to work on desktop, web, and mobile platforms.
Chapter 8, What's Next?, looks at game features to expand on and at resources to continue learning.
The introductory chapter of the book will walk you through getting the tools you need to develop with. However, you will need a computer to develop with. You can develop games with Haxe on Apple OS X, Microsoft Windows, or Linux operating systems.
In order to develop a game for a particular operating system, you will need to have access to a machine with it installed to create playable builds. For example, you need to be using OS X to develop a game targeted at OS X.
For mobile platforms, you can use any operating system to develop Android applications, but you will need a Mac running OS X to develop iOS applications. You will also need an iOS device in order to develop for iOS; this can be an iPhone, iPad, or iPod Touch.
This book is for game developers with some experience in 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 run quickly, this book is for you.
In addition, if you want to learn how using Haxe, OpenFL, and HaxeFlixel can make multiplatform development faster and easier, this book will show you.
Having prior experience with a language similar to Haxe, such as ActionScript or JavaScript, will help, but isn't required.
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Open MenuState.hx
and navigate inside the Create
function."
A block of code is set as follows:
override public function create():Void { super.create(); }
Any command-line input or output is written as follows:
lime test flash
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "If you're using FlashDevelop, you can create a class by right-clicking on the source folder and going to Add | New Class."
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>
, and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from http://www.packtpub.com/sites/default/files/downloads/Haxe_GameDevelopment_Essentials_ColorImages.pdf.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at <[email protected]>
, and we will do our best to address the problem.