Book Image

haXe 2 Beginner's Guide

5 (1)
Book Image

haXe 2 Beginner's Guide

5 (1)

Overview of this book

Table of Contents (21 chapters)
haxe 2
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 2. Basic Syntax and Branching

Basic constructs and making decisions.

In this chapter, we will learn about basic haXe constructs and pieces that make a program. We will also learn about branching (those are indeed constructs too), so that your program can make decisions and choose different paths according to conditions.

In fact, this chapter is one of the most important to get you started because it will teach you how to tell a haXe program what to do.

In this second chapter, we are going to learn quite a lot of things. The great thing is that after this chapter, you will have the knowledge to create programs that won't always do the same things. You will know about all haXe constructs too and therefore, should be able to have fun with haXe.

In this chapter, we will:

  • Learn about modules, packages, and classes

  • Learn about constants

  • Talk about binary and unary operators

  • Learn what blocks are and their particularities

  • Learn about variables and scope

  • Talk about how to access fields and call methods...