Help With Puzzle Game

For questions about using Classic.

Post » Tue Oct 20, 2009 2:26 pm

I've been searching few about a week around and haven't had any luck finding anything on puzzle games with construct. I'm familiar with the basics of Construct and have made a break-out clone and a platformer and now want to try my hand at a puzzle game, but i need some help jumping off because I just cannot think of how to get started. Basically I'd just like to populate a 320x480 gameboard with blocks 32x32, 4 different colors, randomly each time.

For now I'm just trying to get a basic engine in place, build initial board and cause blocks to fill in to spots that are not occupied while I finish nailing down the concept so this isn't another bejeweled clone. But I'd honestly be happy if someone could help point me in the right direction to get started just filling in the board the first time. I feel dumb, but there's just some concept I'm missing and I'm just drawing a complete blank over how to begin.

I'll attach a sample .cap of just a blank board with 4 different color blocks in case it'd be easier to show by example. PuzzleFudge.cap

Thanks a ton in advance, loving Construct a ton.
B
3
S
1
G
3
Posts: 25
Reputation: 1,075

Post » Tue Oct 20, 2009 2:59 pm

Well, there's one Construct puzzle game I know about, since it's my own. :wink:
You can check it out here and this is the thread.

I guess there should be stuff in there that might interest you. There's no source I'm afraid, but I may be able to help you out with particular problems you're having.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Tue Oct 20, 2009 6:07 pm

Yeah I played your game over the weekend. It came out well. I tried a bunch of different things to produce random sprites on the board but I can't seem to find any event actions that will create a random sprite so I'm not sure how to even get it rolling. essentially I'd like it to start off similar to yours, though I'm thinking of having it fill up slower from the bottom (similar to how collapse does) rather than all at once.

Is yours filled in procedurally or is some sort of place holder object replaced with a random skull color?
B
3
S
1
G
3
Posts: 25
Reputation: 1,075

Post » Tue Oct 20, 2009 7:46 pm

Can't believe this idea eluded me but would the way to do it to put each color as a separate frame of animation then tell it to change all of the blocks to a random frame number on layout start and for each subsequent one created?

I can't test this now as I'm at work, I'll throw it together when I get home.
B
3
S
1
G
3
Posts: 25
Reputation: 1,075

Post » Tue Oct 20, 2009 8:38 pm

[quote="mattdubs":2o8bzdo2]Can't believe this idea eluded me but would the way to do it to put each color as a separate frame of animation then tell it to change all of the blocks to a random frame number on layout start and for each subsequent one created[/quote:2o8bzdo2]

Indeed this is how it works. Do it with different frames or animations if needed. :D
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Tue Oct 20, 2009 8:56 pm

Awesome, thanks, I'm glad that worked. Also I can't believe all the random weird events I left in my .cap that I meant to leave blank. oops.

I got the random frame number to work, now to figure out how to call a random animation, only way I can think to is to assign a private variable, have it pick that at random and assign different values to different animations, ie if x=1 set animation to blueShine if x=2 set animation to redShine etc...
B
3
S
1
G
3
Posts: 25
Reputation: 1,075

Post » Tue Oct 20, 2009 9:00 pm

You're thinking too complicated... just name your animations 0, 1, 2, 3... and so on. Then use an event that sets the animation to random(4) for example, if you have the animations mentioned 0-3.

That will do.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Tue Oct 20, 2009 9:19 pm

you're right, I was just about to post, what I said worked, but it seemed convoluted and was wondering if there was an simpler way.

Ok next step, make the blocks swappable and able to fill in open space. I'm thinking of setting it up to function a bit like puzzle league, or henry hatsworth in terms of movement mechanics at least for the time being until we come up with what will make it unique. Thanks for the help. I'm sure I'll have a bunch more questions as I get deeper into this.

Here's an updated .cap with the random colors and animations, 2 animations, each with 4 colors, each block is filled in with a random color from a random tile. PuzzleFudge-01.cap
B
3
S
1
G
3
Posts: 25
Reputation: 1,075

Post » Thu Oct 22, 2009 2:23 am

Ok, so I managed to get a clean way of swapping tiles so the next thing is to cause tiles to fall and fill in if there isn't a tile below them. I've tried a ton of ways and keep getting very unpredictable results.

Best, though messy, way I came up with involves setting a variable to either 0 or 1. 1 if it does not overlap another box (tried with and without offset, identical results). If it is overlapping at offset of (0,3) set to 0. If it's 1 move vertically 1.

Obviously this is way messy and over-complicated. Also it's broken. The offset doesn't seem to recognize positive/negative, so it only falls if there's a gap both below and above.

The use of a variable seems redundant, but if I don't use it, nothing happens. The same conditions that set it to 0 or 1 don't do anything when just told to move the tiles.

I'd really really appreciate some help. :oops:

The .cap
B
3
S
1
G
3
Posts: 25
Reputation: 1,075

Post » Thu Oct 22, 2009 10:57 am

Try to make it work with a private variable. No overlaps needed here. When you destroy a sprite you add to that value for all sprites in the same column.

For example three sprites are destroyed in a column, the above sprites would have to move three fields down. For each destroyed you add 1 to the PV for the sprites in the same column which are above the destroyed ones (compare X position for same column and check Y to see if it's above).

Now you could have an event that runs for each sprite with a PV greater than 0 that tells the sprites to move PV * field size pixels down. That's my basic concept at least. Hope it's helpful to you. :)
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest