Book Image

Learning Construct 2

By : Aryadi Subagio
Book Image

Learning Construct 2

By: Aryadi Subagio

Overview of this book

Table of Contents (17 chapters)
Learning Construct 2
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 4. Making a Breakout Clone

We created our first game in the previous chapter. If you still remember what we did there, we used instance variables to do two things: flap the plane and make the ground scroll. We used only Boolean type instance variables to do what we want, while there are still two other variable types.

These other types can be used to manipulate the state of an object; if you ever see Mario becoming big after eating a mushroom or becoming invincible after getting a star, then you've seen the example of changing the state of an object. We will create something similar in this chapter.

In this chapter, we will cover the following topics:

  • More ways to use instance variables

  • What a constant variable is

  • What an expression is and how to use it

  • How to make an object bounce off other objects

  • What sub-events are