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
Learning Construct 2

You're reading from   Learning Construct 2 Design and create your own engaging, extensible, and addictive game using Construct 2

Arrow left icon
Product type Paperback
Published in Dec 2014
Publisher
ISBN-13 9781784397678
Length 234 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Aryadi Subagio Aryadi Subagio
Author Profile Icon Aryadi Subagio
Aryadi Subagio
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Setting up the layout


As always, we'll begin by creating the layout for our game. Unfortunately, for us, there is no sprite in freebundle.zip that fits a battle tank game. However, we can use two sprites to make a tank: one sprite for the base of the tank and another one for the turret.

First, add two sprite objects to the layout and name them tankTurret and tankBase. The tankBase sprite is from UI elements\Adventure pack. Pick any square icon; in this example, I will use the buttonSquare_blue_pressed image. For the turret, pick an arrow image that points to the right, such as arrowSilver_right. If you place these images on top of each other, you will see an icon similar to the one shown in the following screenshot:

This looks good enough for a tank. However, for it to be called a tank, the base and the turret must act like one, that is, if one is created, so is the other, and if one is destroyed, so is the other. How do we do this? Well, Construct 2 has a feature called container to group...

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