SlideShare a Scribd company logo
1 of 9
Download to read offline
Make a Match-3 Game in
Construct 2: The Basics
Welcome to a new series of tutorials in which I will show you how to build a Match-3
puzzle game, from scratch, in Construct 2. In this first part we are going to lay the
groundwork for the game and get the basic puzzle grid on screen.
Introduction
A Match-3 game is a block-based puzzle where you move blocks around in the game area
to create groups of three or more that share a common attribute (such as a color or a shape).
In most match-3 games the player is also given bonuses for matching more than three
blocks at once.
Most match-3 puzzle games are competitive in nature, and the player's goal is generally
just to get the highest score they can before their time runs out, or some other loss
condition is met. Some examples of match-3 games include Pokemon Puzzle
League, Bejeweled, and the recent hit Candy Crush Saga.
In this first article we are going to focus on laying the groundwork for our game. This
article will focus specifically on setting up the project and spawning a grid of random
blocks for the player.
Before We Begin
Before getting started with this tutorial you should make sure to install the newest version
of Construct 2(C2). When I built the original version of the game I was using Release 122,
so as long as you have a newer version than that, you should be fine. On top of that, if
you've never used C2 before you should check out this guide which details the basics of
using C2 and how to make most object types.
You should also download the graphics package I created for this tutorial. While of course
you can use whatever graphics you want, I will be giving specific positioning for many
items in these tutorials, and those positions are based on the images I used. If you do use
other graphics you will need to account for any size differences in those graphics when
following these tutorials.
Once you have everything set up and have a good understanding of C2, read on!
Setting Up the Project
Before we actually build all of the gameplay, we need to set up the project itself. Load C2
and follow these steps:
1. Start a new project.
2. In the Project Properties, set the Window Size to 600x600 .
3. Fill in the Name and Author fields.
4. Go to the Layers panel and add two new layers.
5. Rename the lowest layer to Background , the middle layer to Blocks , and the top
layer to Game Field .
6. Go into Layout 1 and insert a Tiled Background object.
1. For the Tiled Background object, use BG
Images/StandardBGTile.bmp from the graphics pack.
2. Go to the object's properties and rename it GameBG .
3. Set the object's Layer to Background .
4. Set the object's Size to be 650, 650 .
5. Position the object so it fills the entire visible area of the layout and looks
similar to this:
7. Now, create another Tiled Background object.
1. Use the image Game Field Images/GameFieldBorder.bmp.
2. Name the object GameFieldBorder .
3. Set the Position to 9, -12 .
4. Set the Size to 16, 732 .
5. Set the Layer to Game Field .
8. Create a copy of the GameFieldBorder object.
1. Set the Position of the copy to 368, -12 .
9. Next, create a Sprite object.
1. Use the image Game Field Images/GameFieldBottom.png.
2. Name it GameFieldBottom .
3. Set the Position to 197, 625 .
4. Set the Size to 344, 150 .
5. Set the Layer to Game Field .
10.Make a copy of the GameFieldBottom object.
1. Set the Position to 196, -30 .
2. Set the Angle to 180 .
The final thing we need to do is make a background for the actual area the blocks will
appear in.
1. Create a new Sprite object.
1. Go to the Color Picker and set the Red, Green, and Blue to 0 , and
the Alpha to 200 .
2. Use the Paint Bucket to fill the entire image with this color.
3. Close the animation editor.
4. Set the Size to 359, 570 .
5. Set the Position to 195,294 .
6. Set the Layer to Background
The game field is now complete, but we still have to make a Sprite which can be used for
the Blocks.
1. Make a new Sprite object.
1. With the animation editor open, right-click in the Animation Frames window
and choose "Import frames...".
2. Select every image in the Blocks folder from the graphics pack, and import
them all.
3. Delete Frame 0, so that the gray block image is Frame 0 and there is no blank
frame.
4. Check to make sure your frames are in the same order as my blocks in the
image below:
Before we move forward, I'd like to explain the block images. The gray block is there to
represent an "inactive" block, which will be implemented in an upcoming tutorial. The
remaining images are grouped into sets of three for each block: the first frame is for when
the block is not being used, the second is for when the player is manipulating the block, and
the third is for when the block is matched into a group.
Finally, take the block we've made and place it somewhere in the layout that will prevent
the player from seeing it during an actual game. Also, set the Block's size to 40, 40 .
We have now brought in all the images we need for this article and can move on to actually
making the game work.
Spawning a Random Block Grid
In the final version of the game the blocks will be moving up at all times, and new blocks
will be pushing onto the screen from the bottom. For now, though, we need to get the basic
mechanics working, so we are just going to spawn an 8x8 grid of blocks and leave it at that.
Go to Event Sheet 1 and add these global variables to define the initial spawning position
of the Blocks:
Global Variable: SPAWNX
Value = 49
Constant = True
Global Variable: SPAWNY
Value = 526
Constant = True
We also need to do one other thing before we make the first event: we need to create an
instance variable for the Block that tells the block what color it is.
Create a new instance variable for the Block object, name it Color and don't change any
other settings.
Now we will make our first event. The goal of this event is to create a static grid of blocks
for testing purposes:
Event :
Condition: System>On start of layout
Condition: System>For
Name: "Y"
Start index = 0
End index = 7
Sub-Event: System>For
Name: "X"
Start index = 0
End index = 7
Action: System>Create Object
Object: Block
X = (SPAWNX + (loopIndex("X"))*(Block.Width + 2))
Y = (SPAWNY - (loopIndex("Y"))*(Block.Width + 2))
Both of these formulas say basically the same thing. First, we add 2 to the block width so
that each block has a 2px buffer between it and its neighbors to prevent false positives
when using collision detection. Then, we multiply that number by the current index in the
for loop, and add that to the starting X or Y position. Also, we are subtracting from the Y
value because in C2 the 0 point on the Y axis is at the top of the game screen, so by
decreasing the Y position's value we are putting an object closer to the top of the screen.
So what does this accomplish? This means that as the X and Y loops iterate, and the values
of X and Y increase, the position it puts each block in will change which will eventually
result in a square grid:
If you run the game at this point, you will have a grid of blocks - but, rather than being
different colors, they will all just cycle through every block image in succession.
To fix this we need to do two things.
First, we need to assign each block a color value using the instance variable we made
earlier. To do this, add another Action:
Action: Block>Set value
Color = floor(Random(1,7))
This will assign the block a random color value from 1 to 6. (The reason it's not from 1 to 7
is explained in the explanation of the Random function.)
Your function should now look like this:
We also need to add a system which changes the image of a block based on its value. To do
this, start by adding a new Instance Variable to the Block object:
Instance Variable for Block
Name: "IsMatched"
Type: Boolean
initial value = false
Now, add a new event:
Event: System>Every Tick
Action: Block>Set Frame
Value = (Block.Color-1)*3 + 1
This formula first subtracts 1 from the block's color value to account for the fact that the
values start at 1 rather than 0. Then, it multiplies that number by 3 to account for the fact
that each block has 3 frames of animation. Finally, it adds 1 to that value since the standard
image of a block is the first image in the set of images.
Let's look at a quick example with a Block that has a color value of 4, to see what
animation frame it will be using. First it subtracts 1 from the color value to get 3. Next it
multiplies that number by 3 to make 9. Finally it adds 1 to that value to make 10. This
means that a Block with a color value of 4 will use frame 10 as its default animation frame,
and will be a purple/square Block.
If you run your game now you will see that every block is a different color, but we still
haven't implemented animations for when your mouse is hovering over the block or for
when it is matched. This will be covered in the next tutorial, along with how to swap two
neighboring Blocks.
Here is a small demo of what the game should look like at this point (grab the source here):
If you want to continue working on your own, start looking at changing the Block's
animation frame based on a "Mouse > Cursor is over object" event. You could also start
looking at using the "Drag & Drop" behavior to manipulate the Block, and considering how
to determine what the player is trying to do with the Block when they start dragging it or
when they drop it.
Conclusion
Thanks for reading this part of the tutorial, where we set the basic groundwork for our
Match-3 game. Come back again soon for the next part of the series! You can keep up to
date via Facebook, Twitter, Google+, RSS, or email.

More Related Content

What's hot

The Ring programming language version 1.3 book - Part 43 of 88
The Ring programming language version 1.3 book - Part 43 of 88The Ring programming language version 1.3 book - Part 43 of 88
The Ring programming language version 1.3 book - Part 43 of 88Mahmoud Samir Fayed
 
Green My Place Game7 Switch Search
Green My Place Game7 Switch SearchGreen My Place Game7 Switch Search
Green My Place Game7 Switch SearchBen Cowley
 
Ankit Phadia Hacking tools (1)
Ankit Phadia Hacking tools (1)Ankit Phadia Hacking tools (1)
Ankit Phadia Hacking tools (1)Chandra Pr. Singh
 
The Ring programming language version 1.7 book - Part 74 of 196
The Ring programming language version 1.7 book - Part 74 of 196The Ring programming language version 1.7 book - Part 74 of 196
The Ring programming language version 1.7 book - Part 74 of 196Mahmoud Samir Fayed
 
Lesson 19: Optimization Problems
Lesson 19: Optimization ProblemsLesson 19: Optimization Problems
Lesson 19: Optimization ProblemsMatthew Leingang
 
The Ring programming language version 1.4.1 book - Part 19 of 31
The Ring programming language version 1.4.1 book - Part 19 of 31The Ring programming language version 1.4.1 book - Part 19 of 31
The Ring programming language version 1.4.1 book - Part 19 of 31Mahmoud Samir Fayed
 
Lesson 20: (More) Optimization Problems
Lesson 20: (More) Optimization ProblemsLesson 20: (More) Optimization Problems
Lesson 20: (More) Optimization ProblemsMatthew Leingang
 
The Ring programming language version 1.8 book - Part 76 of 202
The Ring programming language version 1.8 book - Part 76 of 202The Ring programming language version 1.8 book - Part 76 of 202
The Ring programming language version 1.8 book - Part 76 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 53 of 202
The Ring programming language version 1.8 book - Part 53 of 202The Ring programming language version 1.8 book - Part 53 of 202
The Ring programming language version 1.8 book - Part 53 of 202Mahmoud Samir Fayed
 
Run and jump tutorial (part 2) scenes
Run and jump tutorial (part 2)   scenesRun and jump tutorial (part 2)   scenes
Run and jump tutorial (part 2) scenesMuhd Basheer
 
Java ME - 05 - Game API
Java ME - 05 - Game APIJava ME - 05 - Game API
Java ME - 05 - Game APIAndreas Jakl
 
The Ring programming language version 1.7 book - Part 54 of 196
The Ring programming language version 1.7 book - Part 54 of 196The Ring programming language version 1.7 book - Part 54 of 196
The Ring programming language version 1.7 book - Part 54 of 196Mahmoud Samir Fayed
 

What's hot (20)

The Ring programming language version 1.3 book - Part 43 of 88
The Ring programming language version 1.3 book - Part 43 of 88The Ring programming language version 1.3 book - Part 43 of 88
The Ring programming language version 1.3 book - Part 43 of 88
 
Green My Place Game7 Switch Search
Green My Place Game7 Switch SearchGreen My Place Game7 Switch Search
Green My Place Game7 Switch Search
 
2dworkflow complete
2dworkflow complete2dworkflow complete
2dworkflow complete
 
Web_Alg_Project
Web_Alg_ProjectWeb_Alg_Project
Web_Alg_Project
 
presentazione
presentazionepresentazione
presentazione
 
Work flow
Work flowWork flow
Work flow
 
Ankit Phadia Hacking tools (1)
Ankit Phadia Hacking tools (1)Ankit Phadia Hacking tools (1)
Ankit Phadia Hacking tools (1)
 
The Ring programming language version 1.7 book - Part 74 of 196
The Ring programming language version 1.7 book - Part 74 of 196The Ring programming language version 1.7 book - Part 74 of 196
The Ring programming language version 1.7 book - Part 74 of 196
 
09 bootstrapping
09 bootstrapping09 bootstrapping
09 bootstrapping
 
Lesson 19: Optimization Problems
Lesson 19: Optimization ProblemsLesson 19: Optimization Problems
Lesson 19: Optimization Problems
 
The Ring programming language version 1.4.1 book - Part 19 of 31
The Ring programming language version 1.4.1 book - Part 19 of 31The Ring programming language version 1.4.1 book - Part 19 of 31
The Ring programming language version 1.4.1 book - Part 19 of 31
 
Lesson 20: (More) Optimization Problems
Lesson 20: (More) Optimization ProblemsLesson 20: (More) Optimization Problems
Lesson 20: (More) Optimization Problems
 
Workflow document
Workflow documentWorkflow document
Workflow document
 
The Ring programming language version 1.8 book - Part 76 of 202
The Ring programming language version 1.8 book - Part 76 of 202The Ring programming language version 1.8 book - Part 76 of 202
The Ring programming language version 1.8 book - Part 76 of 202
 
The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88
 
The Ring programming language version 1.8 book - Part 53 of 202
The Ring programming language version 1.8 book - Part 53 of 202The Ring programming language version 1.8 book - Part 53 of 202
The Ring programming language version 1.8 book - Part 53 of 202
 
Run and jump tutorial (part 2) scenes
Run and jump tutorial (part 2)   scenesRun and jump tutorial (part 2)   scenes
Run and jump tutorial (part 2) scenes
 
Java ME - 05 - Game API
Java ME - 05 - Game APIJava ME - 05 - Game API
Java ME - 05 - Game API
 
The Ring programming language version 1.7 book - Part 54 of 196
The Ring programming language version 1.7 book - Part 54 of 196The Ring programming language version 1.7 book - Part 54 of 196
The Ring programming language version 1.7 book - Part 54 of 196
 
Chpater 6
Chpater 6Chpater 6
Chpater 6
 

Similar to Make a match3

Unity - Create a structure with primitives
Unity - Create a structure with primitivesUnity - Create a structure with primitives
Unity - Create a structure with primitivesNexusEdgesupport
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditBibekPandit2
 
How tomakea gameinunity3d
How tomakea gameinunity3dHow tomakea gameinunity3d
How tomakea gameinunity3dDao Tung
 
2d game engine workflow
2d game engine workflow2d game engine workflow
2d game engine workflowluisfvazquez1
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)noorcon
 
The Ring programming language version 1.4 book - Part 14 of 30
The Ring programming language version 1.4 book - Part 14 of 30The Ring programming language version 1.4 book - Part 14 of 30
The Ring programming language version 1.4 book - Part 14 of 30Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 53 of 196
The Ring programming language version 1.7 book - Part 53 of 196The Ring programming language version 1.7 book - Part 53 of 196
The Ring programming language version 1.7 book - Part 53 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 36 of 84
The Ring programming language version 1.2 book - Part 36 of 84The Ring programming language version 1.2 book - Part 36 of 84
The Ring programming language version 1.2 book - Part 36 of 84Mahmoud Samir Fayed
 
Work flow the pain is reel
Work flow the pain is reelWork flow the pain is reel
Work flow the pain is reelShaz Riches
 
Lab Assignment 17 - Working with Object ArraysIn the old days we w.pdf
Lab Assignment 17 - Working with Object ArraysIn the old days we w.pdfLab Assignment 17 - Working with Object ArraysIn the old days we w.pdf
Lab Assignment 17 - Working with Object ArraysIn the old days we w.pdfeyewaregallery
 
asmt7~$sc_210_-_assignment_7_fall_15.docasmt7cosc_210_-_as.docx
asmt7~$sc_210_-_assignment_7_fall_15.docasmt7cosc_210_-_as.docxasmt7~$sc_210_-_assignment_7_fall_15.docasmt7cosc_210_-_as.docx
asmt7~$sc_210_-_assignment_7_fall_15.docasmt7cosc_210_-_as.docxfredharris32
 
Unity - Building your first real-time 3D project
Unity - Building your first real-time 3D projectUnity - Building your first real-time 3D project
Unity - Building your first real-time 3D projectNexusEdgesupport
 
The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184Mahmoud Samir Fayed
 
Run and jump tutorial (part 1) actors
Run and jump tutorial (part 1)   actorsRun and jump tutorial (part 1)   actors
Run and jump tutorial (part 1) actorsMuhd Basheer
 
Unity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All SlidesUnity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All SlidesNexusEdgesupport
 
Unity3d scripting tutorial
Unity3d scripting tutorialUnity3d scripting tutorial
Unity3d scripting tutorialhungnttg
 
A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationgraphitech
 

Similar to Make a match3 (20)

Unity - Create a structure with primitives
Unity - Create a structure with primitivesUnity - Create a structure with primitives
Unity - Create a structure with primitives
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek pandit
 
How tomakea gameinunity3d
How tomakea gameinunity3dHow tomakea gameinunity3d
How tomakea gameinunity3d
 
2d game engine workflow
2d game engine workflow2d game engine workflow
2d game engine workflow
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
 
The Ring programming language version 1.4 book - Part 14 of 30
The Ring programming language version 1.4 book - Part 14 of 30The Ring programming language version 1.4 book - Part 14 of 30
The Ring programming language version 1.4 book - Part 14 of 30
 
The Ring programming language version 1.7 book - Part 53 of 196
The Ring programming language version 1.7 book - Part 53 of 196The Ring programming language version 1.7 book - Part 53 of 196
The Ring programming language version 1.7 book - Part 53 of 196
 
The Ring programming language version 1.2 book - Part 36 of 84
The Ring programming language version 1.2 book - Part 36 of 84The Ring programming language version 1.2 book - Part 36 of 84
The Ring programming language version 1.2 book - Part 36 of 84
 
Work flow
Work flowWork flow
Work flow
 
Work flow the pain is reel
Work flow the pain is reelWork flow the pain is reel
Work flow the pain is reel
 
Lab Assignment 17 - Working with Object ArraysIn the old days we w.pdf
Lab Assignment 17 - Working with Object ArraysIn the old days we w.pdfLab Assignment 17 - Working with Object ArraysIn the old days we w.pdf
Lab Assignment 17 - Working with Object ArraysIn the old days we w.pdf
 
asmt7~$sc_210_-_assignment_7_fall_15.docasmt7cosc_210_-_as.docx
asmt7~$sc_210_-_assignment_7_fall_15.docasmt7cosc_210_-_as.docxasmt7~$sc_210_-_assignment_7_fall_15.docasmt7cosc_210_-_as.docx
asmt7~$sc_210_-_assignment_7_fall_15.docasmt7cosc_210_-_as.docx
 
a3.pdf
a3.pdfa3.pdf
a3.pdf
 
Unity - Building your first real-time 3D project
Unity - Building your first real-time 3D projectUnity - Building your first real-time 3D project
Unity - Building your first real-time 3D project
 
The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184
 
Run and jump tutorial (part 1) actors
Run and jump tutorial (part 1)   actorsRun and jump tutorial (part 1)   actors
Run and jump tutorial (part 1) actors
 
Unity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All SlidesUnity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All Slides
 
Unity3d scripting tutorial
Unity3d scripting tutorialUnity3d scripting tutorial
Unity3d scripting tutorial
 
A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolation
 
Work flow
Work flowWork flow
Work flow
 

Recently uploaded

E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxJackieSparrow3
 
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot AndCall Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot AndPooja Nehwal
 
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝soniya singh
 
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ EscortsDelhi Escorts Service
 
Postal Ballot procedure for employees to utilise
Postal Ballot procedure for employees to utilisePostal Ballot procedure for employees to utilise
Postal Ballot procedure for employees to utiliseccsubcollector
 
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...ur8mqw8e
 
Dhule Call Girls #9907093804 Contact Number Escorts Service Dhule
Dhule Call Girls #9907093804 Contact Number Escorts Service DhuleDhule Call Girls #9907093804 Contact Number Escorts Service Dhule
Dhule Call Girls #9907093804 Contact Number Escorts Service Dhulesrsj9000
 
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...anilsa9823
 
social media chat application main ppt.pptx
social media chat application main ppt.pptxsocial media chat application main ppt.pptx
social media chat application main ppt.pptxsprasad829829
 
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfBreath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfJess Walker
 
Lilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxLilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxABMWeaklings
 
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdfREFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdfssusere8ea60
 
办理西悉尼大学毕业证成绩单、制作假文凭
办理西悉尼大学毕业证成绩单、制作假文凭办理西悉尼大学毕业证成绩单、制作假文凭
办理西悉尼大学毕业证成绩单、制作假文凭o8wvnojp
 
Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666nishakur201
 
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...CIOWomenMagazine
 
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改atducpo
 
Cheap Rate ➥8448380779 ▻Call Girls In Mg Road Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Mg Road GurgaonCheap Rate ➥8448380779 ▻Call Girls In Mg Road Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Mg Road GurgaonDelhi Call girls
 
Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝soniya singh
 

Recently uploaded (20)

E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptx
 
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot AndCall Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
 
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
 
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
 
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
 
Postal Ballot procedure for employees to utilise
Postal Ballot procedure for employees to utilisePostal Ballot procedure for employees to utilise
Postal Ballot procedure for employees to utilise
 
escort service sasti (*~Call Girls in Paschim Vihar Metro❤️9953056974
escort service  sasti (*~Call Girls in Paschim Vihar Metro❤️9953056974escort service  sasti (*~Call Girls in Paschim Vihar Metro❤️9953056974
escort service sasti (*~Call Girls in Paschim Vihar Metro❤️9953056974
 
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
 
Dhule Call Girls #9907093804 Contact Number Escorts Service Dhule
Dhule Call Girls #9907093804 Contact Number Escorts Service DhuleDhule Call Girls #9907093804 Contact Number Escorts Service Dhule
Dhule Call Girls #9907093804 Contact Number Escorts Service Dhule
 
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
 
social media chat application main ppt.pptx
social media chat application main ppt.pptxsocial media chat application main ppt.pptx
social media chat application main ppt.pptx
 
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfBreath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
 
Lilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxLilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptx
 
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdfREFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
 
办理西悉尼大学毕业证成绩单、制作假文凭
办理西悉尼大学毕业证成绩单、制作假文凭办理西悉尼大学毕业证成绩单、制作假文凭
办理西悉尼大学毕业证成绩单、制作假文凭
 
Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666
 
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
 
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
 
Cheap Rate ➥8448380779 ▻Call Girls In Mg Road Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Mg Road GurgaonCheap Rate ➥8448380779 ▻Call Girls In Mg Road Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Mg Road Gurgaon
 
Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝
 

Make a match3

  • 1. Make a Match-3 Game in Construct 2: The Basics Welcome to a new series of tutorials in which I will show you how to build a Match-3 puzzle game, from scratch, in Construct 2. In this first part we are going to lay the groundwork for the game and get the basic puzzle grid on screen. Introduction A Match-3 game is a block-based puzzle where you move blocks around in the game area to create groups of three or more that share a common attribute (such as a color or a shape). In most match-3 games the player is also given bonuses for matching more than three blocks at once. Most match-3 puzzle games are competitive in nature, and the player's goal is generally just to get the highest score they can before their time runs out, or some other loss condition is met. Some examples of match-3 games include Pokemon Puzzle League, Bejeweled, and the recent hit Candy Crush Saga. In this first article we are going to focus on laying the groundwork for our game. This article will focus specifically on setting up the project and spawning a grid of random blocks for the player. Before We Begin Before getting started with this tutorial you should make sure to install the newest version of Construct 2(C2). When I built the original version of the game I was using Release 122, so as long as you have a newer version than that, you should be fine. On top of that, if you've never used C2 before you should check out this guide which details the basics of using C2 and how to make most object types. You should also download the graphics package I created for this tutorial. While of course you can use whatever graphics you want, I will be giving specific positioning for many items in these tutorials, and those positions are based on the images I used. If you do use other graphics you will need to account for any size differences in those graphics when following these tutorials.
  • 2. Once you have everything set up and have a good understanding of C2, read on! Setting Up the Project Before we actually build all of the gameplay, we need to set up the project itself. Load C2 and follow these steps: 1. Start a new project. 2. In the Project Properties, set the Window Size to 600x600 . 3. Fill in the Name and Author fields. 4. Go to the Layers panel and add two new layers. 5. Rename the lowest layer to Background , the middle layer to Blocks , and the top layer to Game Field . 6. Go into Layout 1 and insert a Tiled Background object. 1. For the Tiled Background object, use BG Images/StandardBGTile.bmp from the graphics pack. 2. Go to the object's properties and rename it GameBG . 3. Set the object's Layer to Background . 4. Set the object's Size to be 650, 650 . 5. Position the object so it fills the entire visible area of the layout and looks similar to this:
  • 3. 7. Now, create another Tiled Background object. 1. Use the image Game Field Images/GameFieldBorder.bmp. 2. Name the object GameFieldBorder . 3. Set the Position to 9, -12 . 4. Set the Size to 16, 732 . 5. Set the Layer to Game Field . 8. Create a copy of the GameFieldBorder object. 1. Set the Position of the copy to 368, -12 . 9. Next, create a Sprite object. 1. Use the image Game Field Images/GameFieldBottom.png. 2. Name it GameFieldBottom . 3. Set the Position to 197, 625 . 4. Set the Size to 344, 150 . 5. Set the Layer to Game Field . 10.Make a copy of the GameFieldBottom object. 1. Set the Position to 196, -30 . 2. Set the Angle to 180 .
  • 4. The final thing we need to do is make a background for the actual area the blocks will appear in. 1. Create a new Sprite object. 1. Go to the Color Picker and set the Red, Green, and Blue to 0 , and the Alpha to 200 . 2. Use the Paint Bucket to fill the entire image with this color. 3. Close the animation editor. 4. Set the Size to 359, 570 . 5. Set the Position to 195,294 . 6. Set the Layer to Background
  • 5. The game field is now complete, but we still have to make a Sprite which can be used for the Blocks. 1. Make a new Sprite object. 1. With the animation editor open, right-click in the Animation Frames window and choose "Import frames...". 2. Select every image in the Blocks folder from the graphics pack, and import them all. 3. Delete Frame 0, so that the gray block image is Frame 0 and there is no blank frame. 4. Check to make sure your frames are in the same order as my blocks in the image below: Before we move forward, I'd like to explain the block images. The gray block is there to represent an "inactive" block, which will be implemented in an upcoming tutorial. The remaining images are grouped into sets of three for each block: the first frame is for when the block is not being used, the second is for when the player is manipulating the block, and the third is for when the block is matched into a group. Finally, take the block we've made and place it somewhere in the layout that will prevent the player from seeing it during an actual game. Also, set the Block's size to 40, 40 . We have now brought in all the images we need for this article and can move on to actually making the game work. Spawning a Random Block Grid In the final version of the game the blocks will be moving up at all times, and new blocks will be pushing onto the screen from the bottom. For now, though, we need to get the basic mechanics working, so we are just going to spawn an 8x8 grid of blocks and leave it at that.
  • 6. Go to Event Sheet 1 and add these global variables to define the initial spawning position of the Blocks: Global Variable: SPAWNX Value = 49 Constant = True Global Variable: SPAWNY Value = 526 Constant = True We also need to do one other thing before we make the first event: we need to create an instance variable for the Block that tells the block what color it is. Create a new instance variable for the Block object, name it Color and don't change any other settings. Now we will make our first event. The goal of this event is to create a static grid of blocks for testing purposes: Event : Condition: System>On start of layout Condition: System>For Name: "Y" Start index = 0 End index = 7 Sub-Event: System>For Name: "X" Start index = 0 End index = 7
  • 7. Action: System>Create Object Object: Block X = (SPAWNX + (loopIndex("X"))*(Block.Width + 2)) Y = (SPAWNY - (loopIndex("Y"))*(Block.Width + 2)) Both of these formulas say basically the same thing. First, we add 2 to the block width so that each block has a 2px buffer between it and its neighbors to prevent false positives when using collision detection. Then, we multiply that number by the current index in the for loop, and add that to the starting X or Y position. Also, we are subtracting from the Y value because in C2 the 0 point on the Y axis is at the top of the game screen, so by decreasing the Y position's value we are putting an object closer to the top of the screen. So what does this accomplish? This means that as the X and Y loops iterate, and the values of X and Y increase, the position it puts each block in will change which will eventually result in a square grid: If you run the game at this point, you will have a grid of blocks - but, rather than being different colors, they will all just cycle through every block image in succession. To fix this we need to do two things. First, we need to assign each block a color value using the instance variable we made earlier. To do this, add another Action: Action: Block>Set value Color = floor(Random(1,7)) This will assign the block a random color value from 1 to 6. (The reason it's not from 1 to 7 is explained in the explanation of the Random function.) Your function should now look like this: We also need to add a system which changes the image of a block based on its value. To do this, start by adding a new Instance Variable to the Block object:
  • 8. Instance Variable for Block Name: "IsMatched" Type: Boolean initial value = false Now, add a new event: Event: System>Every Tick Action: Block>Set Frame Value = (Block.Color-1)*3 + 1 This formula first subtracts 1 from the block's color value to account for the fact that the values start at 1 rather than 0. Then, it multiplies that number by 3 to account for the fact that each block has 3 frames of animation. Finally, it adds 1 to that value since the standard image of a block is the first image in the set of images. Let's look at a quick example with a Block that has a color value of 4, to see what animation frame it will be using. First it subtracts 1 from the color value to get 3. Next it multiplies that number by 3 to make 9. Finally it adds 1 to that value to make 10. This means that a Block with a color value of 4 will use frame 10 as its default animation frame, and will be a purple/square Block. If you run your game now you will see that every block is a different color, but we still haven't implemented animations for when your mouse is hovering over the block or for when it is matched. This will be covered in the next tutorial, along with how to swap two neighboring Blocks. Here is a small demo of what the game should look like at this point (grab the source here):
  • 9. If you want to continue working on your own, start looking at changing the Block's animation frame based on a "Mouse > Cursor is over object" event. You could also start looking at using the "Drag & Drop" behavior to manipulate the Block, and considering how to determine what the player is trying to do with the Block when they start dragging it or when they drop it. Conclusion Thanks for reading this part of the tutorial, where we set the basic groundwork for our Match-3 game. Come back again soon for the next part of the series! You can keep up to date via Facebook, Twitter, Google+, RSS, or email.