Blocks getting out of alignment ...

Get help using Construct 2

Post » Mon Sep 15, 2014 11:20 am

I'm currently making a match-3 (Candy Crush type) game with 7 columns and 7 rows of blocks. However, I keep running into the same problem.

For some reason when my blocks move down within the column they aren't always lined up exactly as they should be even though the code is the same for all blocks. I've used "set angle of motion" and "set Y" for blocks that are not "overlapping at offset" the bottom or other blocks. The blocks move down when the block beneath is destroyed, but it stops at different places. Half of the the blocks lineup straight while the other blocks sometimes overlap the block beneath, overlap the bottom or just don't line up perfectly. Is there a way to keep my columns and rows straight?

Any advice is appreciated. Thanks.
B
3
Posts: 4
Reputation: 223

Post » Mon Sep 15, 2014 11:26 am

It would be easier with some screenshots or better a .capx
B
7
Posts: 16
Reputation: 315

Post » Mon Sep 15, 2014 2:36 pm

I had a similar issue with a boulderdash style game I made once. What behaviours are you using for the blocks? Checking for overlapping at offset can cause issues, and there are several workarounds.

One possible way to do it is to have the blocks correct themselves when they stop falling. i.e. when overlapping at offset stop falling and then immediately move the block into the right position (which will be the Y of the block it is overlapping with + its height) in the same frame.

I can provide a short event block to illustrate this if you prefer.
Intermediate level Construct 2 developer, looking to build up my portfolio : https://seriouslycrunchy.itch.io/

Current projects : Bite Sized Game Development, please have a look at my tutorials and comment!

I also write for http://moonbooks.net/, please come and check us out!

Follow me on twitter! @SrslyCrunchy I'm always looking for games or templates to highlight, use the hashtag #madeinconstruct !
B
15
S
7
Posts: 52
Reputation: 3,126

Post » Mon Sep 15, 2014 8:20 pm

Actually, @SeriouslyCrunchy an example would be very much appreciated. I can understand what you're saying, but it would be easier for me to visualize it. And if it doesn't go quite the way I'd hoped, I'll post a capx of what I have so far.

Thanks in advance.
B
3
Posts: 4
Reputation: 223

Post » Mon Sep 15, 2014 11:12 pm

Alright, I haven't had time to do it this evening so i'll sort an example for you in the morning.
Intermediate level Construct 2 developer, looking to build up my portfolio : https://seriouslycrunchy.itch.io/

Current projects : Bite Sized Game Development, please have a look at my tutorials and comment!

I also write for http://moonbooks.net/, please come and check us out!

Follow me on twitter! @SrslyCrunchy I'm always looking for games or templates to highlight, use the hashtag #madeinconstruct !
B
15
S
7
Posts: 52
Reputation: 3,126

Post » Tue Sep 16, 2014 3:48 pm

Sorry for the double post but it seems I've misplaced the capx for my boulderdash game, I was going to grab a few screenshots of the events from that! Whoops!

However, a perhaps better workaround is giving all the blocks the platformer and solid behaviours, and turning off default controls for the platformer. This negates the need to use 'overlapping at offset' entirely, which I have had some issues with a few times in C2.

Give it a go and let me know how it goes!
Intermediate level Construct 2 developer, looking to build up my portfolio : https://seriouslycrunchy.itch.io/

Current projects : Bite Sized Game Development, please have a look at my tutorials and comment!

I also write for http://moonbooks.net/, please come and check us out!

Follow me on twitter! @SrslyCrunchy I'm always looking for games or templates to highlight, use the hashtag #madeinconstruct !
B
15
S
7
Posts: 52
Reputation: 3,126

Post » Wed Sep 17, 2014 12:48 am

Thanks for the advice, @SeriouslyCrunchy! I appreciate the response. I'll give that a shot!
B
3
Posts: 4
Reputation: 223

Post » Wed Sep 17, 2014 3:39 am

I had the exact same problem when creating a tetris clone before. The best solution is to "snap" your piece in place. You could place invisible markers at each rows. Than when you want it to, use the pick nearest invisible marker, than set your piece Y to the invisible marker.Y. That will make sure your pieces are always precise in terms of position.
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Thu Sep 18, 2014 3:20 am

Thanks, @rekjl! That seems like another good fix! I appreciate the response!
B
3
Posts: 4
Reputation: 223


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests