A basic Puzzle example (Now it even swaps back!)

Post your own tutorials, guides and demos.

Post » Sun Nov 08, 2009 2:20 pm

Due to popular request: This is a tutorial/example from which you can learn how to make a puzzle game in Construct. One of the kind where you have to match three or more blocks horziontally or vertically.

Let me briefly mention that I wouldn't recommend this for absolute beginners. So if you installed Construct just yesterday, you should probably get a little more familiar with it before you check out this tutorial.

This is just my personal approach and doesn't claim to be the way to go.


Part 1 - Playfield Generation


First things first. So we start out with the generation of the playfield. Simply randomized blocks won't do, because we don't want three or more blocks being matched in the beginning.

So let's use an array, some sweet sweet loops and basically crazy stuff.   
All in the cap, all commented, there you go:

DOWNLOAD PART 1
(File created with version 0.99.42 of Construct)


Part 2 - Swapping, Matching & Destroying


Now we get to the really important stuff. After all a cool puzzle game can't work if matching blocks aren't even recognized. It's not quite as simple this time, but nothing to worry about either.

Expect more loops, crazy Else events and... you name it!

DOWNLOAD PART 2
(File created with version 0.99.42 of Construct)

Oh, this time you will really need the Contrast Plus effect. Go get it here:
[url:3dkbwxlw]http://scirra.com/phpbb3/viewtopic.php?f=16&t=4835[/url:3dkbwxlw]


Part 3 - Spawning


What's left to do is filling up those unwanted gaps with brand-new blocks.

How is it done? Of course with some nasty events, featuring loops and all the other stuff your parents warned you about!

DOWNLOAD PART 3
(File created with version 0.99.42 of Construct)


Part 3.1 - Now it even swaps back!

Here's the functionality some of you have been yearning for: blocks are swapped right back if there hasn't been a match. Thank sweet baby jesus!

Note: All of the newly added comments have green text color on black ground, so you can easily spot them.

DOWNLOAD PART 3.1
(File created with version 1.2 of Construct Classic)


Also still available: alternative first part

DOWNLOAD ALTERNATIVE PART 1
(File created with version 0.99.42 of Construct) PixelRebirth2011-07-13 15:36:28
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sun Nov 08, 2009 2:35 pm

when i try to open it an error comes up saying
[quote:230emgzx]The effect file 'Constrast Plus.fx' is required to open this file. Please locate it and put it in your effects directory under your Construct installation.[/quote:230emgzx]

what is this.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Sun Nov 08, 2009 2:40 pm

Oh, great that you mention this. I don't know why it is in there. Removed and updated. :)

Btw Contrast Plus is a very good FX by jeffro11 you should get it asap!
http://69.24.73.172/scirra/forum/viewtopic.php?f=16&t=4835
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sun Nov 08, 2009 3:12 pm

Thank you. This is a nice start. I can't wait to see more.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Sun Nov 08, 2009 3:23 pm

Wow! Great tutorial!
Thank you!

I'm looking forward for the next part
B
3
S
2
G
3
Posts: 146
Reputation: 1,567

Post » Mon Nov 09, 2009 4:47 am

PixelRebirth is the man, beat me to posting. I did a similar exampling using what he taught me in my thread and what was written in mary jane's.

Just went through it, I noticed you referenced an object as to where to start creation, not totally necessary if you're designing with a grid, you can just do array's current x + 32 for example and it will fill in every spot until it runs out of space. Though your method works just as easily, I don't think one way is better than the other. The tiled bg does make it more 'mobile' for editing where it lays in the layout.

Thanks a ton for the tutorial. It's gonna help me get my 'action' puzzler finished up. Just need to figure out if an array is the right way to create my blocks since there will be a constant generation going on from the bottom.
B
3
S
1
G
3
Posts: 25
Reputation: 1,075

Post » Mon Nov 09, 2009 10:58 am

Thx to everybody for commenting. :D

[quote="mattdubs":3g4bgkjg]Just went through it, I noticed you referenced an object as to where to start creation, not totally necessary if you're designing with a grid, you can just do array's current x + 32 for example and it will fill in every spot until it runs out of space. Though your method works just as easily, I don't think one way is better than the other. The tiled bg does make it more 'mobile' for editing where it lays in the layout.[/quote:3g4bgkjg]

You're totally right. It's just the way I prefer to do it. You could get rid of the tiled bg with some adjustments anytime.

[quote="mattdubs":3g4bgkjg]Thanks a ton for the tutorial. It's gonna help me get my 'action' puzzler finished up. Just need to figure out if an array is the right way to create my blocks since there will be a constant generation going on from the bottom.[/quote:3g4bgkjg]

Spawning of blocks will be the topic of the third part. It should be adjustable to a constant spawning too, depending on the game mechanics you aim for. I don't think an array will pose a problem with that, at least not the (pretty limited) way I use it.

Expect the second part to be online later today or at least tomorrow. :)
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Mon Nov 09, 2009 12:55 pm

Awesome, lookin forward to it.
B
3
S
1
G
3
Posts: 25
Reputation: 1,075

Post » Mon Nov 09, 2009 7:56 pm

Okay folks, part 2 is online now!

I hope there are not too many typos or even crude mistakes in there. :wink:
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Mon Nov 09, 2009 9:53 pm

Completely awesome pixel. Thanks a ton for sharing.

I'd say for that type of matching puzzle, in a finished version you should disable swaps that don't result in a match. Obviously it's up to the mechanics you want, but being able to move them freely takes some challenge out.
B
3
S
1
G
3
Posts: 25
Reputation: 1,075

Next

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 2 guests