Reader small image

You're reading from  Learning Construct 2

Product typeBook
Published inDec 2014
Reading LevelIntermediate
Publisher
ISBN-139781784397678
Edition1st Edition
Languages
Right arrow
Author (1)
Aryadi Subagio
Aryadi Subagio
author image
Aryadi Subagio

Aryadi Subagio is the second among seven brothers. He has loved video games ever since he was little, and he wanted to make his own game in his teenage years. This led him to pursue a Diploma in Computer Programming after he graduated from high school, where he spent years learning about software development techniques. He learned about game development from online sites, because at that time, there was no book on game development in Indonesia. After graduating, he immediately jumped into the world of game development. During this time, he made a few shooting games for the Flash Platform. After a year, he decided to gain more experience by working in a game studio; this is when he joined Esabra Studio. After working at Esabra Studio, he worked at Enthrean Guardian, a game studio based in Semarang. He has now quit working and is trying to set up his own studio. Aryadi has a passion for sharing his knowledge. He has written a lot of blog posts about game development on Indonesian and English sites. He also shares his knowledge on his own personal blog at http://daggio21.blogspot.com/.
Read more about Aryadi Subagio

Right arrow

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 page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Construct 2
Published in: Dec 2014Publisher: ISBN-13: 9781784397678

Author (1)

author image
Aryadi Subagio

Aryadi Subagio is the second among seven brothers. He has loved video games ever since he was little, and he wanted to make his own game in his teenage years. This led him to pursue a Diploma in Computer Programming after he graduated from high school, where he spent years learning about software development techniques. He learned about game development from online sites, because at that time, there was no book on game development in Indonesia. After graduating, he immediately jumped into the world of game development. During this time, he made a few shooting games for the Flash Platform. After a year, he decided to gain more experience by working in a game studio; this is when he joined Esabra Studio. After working at Esabra Studio, he worked at Enthrean Guardian, a game studio based in Semarang. He has now quit working and is trying to set up his own studio. Aryadi has a passion for sharing his knowledge. He has written a lot of blog posts about game development on Indonesian and English sites. He also shares his knowledge on his own personal blog at http://daggio21.blogspot.com/.
Read more about Aryadi Subagio