Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Construct 2 Game Development by Example

You're reading from   Construct 2 Game Development by Example Learn how to make games for multiple platforms with Construct 2.

Arrow left icon
Product type Paperback
Published in Jun 2014
Publisher
ISBN-13 9781849698061
Length 230 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
John Bura John Bura
Author Profile Icon John Bura
John Bura
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Getting Started with Construct 2 FREE CHAPTER 2. Inputs and Controls 3. Variables and Arrays 4. Game Mechanics 5. Making a Simple Shooter 6. Making a Tower Defense Game 7. Making a Puzzle Physics Game 8. Exporting Your Game A. Where to Go from Here
Index

Setting up an enemy wave


We need to set up the amount of green balls that get spawned. When we push the WaveButton, a new wave should start. Let's go ahead and add a global variable by right-clicking on the event sheet and adding a global variable. Let's call it waveCount and set its Initial value to 3, as shown in the following screenshot:

Create another variable called ballCount. Set its Initial value to 0. The wave count is going to count how many total green balls are going to be spawned in a wave, and the ball count will count how many balls are on screen. We need both of these variables in order to make it work. Generally, you want to try and use the least amount of variables as possible—but often the least amount can still be a lot of variables. Even in some small games I've seen, the variable count exceeds 200.

Once you have created this global variable, let's use it. Add an event to the green ball and select the On created event, as shown in the following screenshot:

Once you have...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image