Attempting Match-3 style gameplay with physics

For questions about using Classic.

Post » Fri Jun 05, 2009 6:16 am

Hey folks,

I'm trying to make a sort of match-3 style game using physics. So, there will be a number of coloured boxes falling from the top of the screen and you can smash them into each other and when they do, similarly coloured boxes stick together and when you have 3 or more boxes, they will disappear or do something.

I tried making a "when box collides with box" event then having a "make a hinge between box and box" action, but it doesn't work. Is it getting confused at which box to make a hinge to? How do i differentiate the collider and the collid...ee?

Also, i'm curious as to how i'm going to link the boxes together so i can perform some sort of action on them. I noticed the ObjectPairer object and tried looking up some info on it, but found none. Can someone fill me in on how that thing works and also let me know if it will help me in my endeavours?

Any ideas will be much appreciated.

Thanks!

EDIT: Okay, well i found a way to make the hinges work.

The box object is now the member of two different families and when i do the events and actions, i make sure to use the opposing families. For example, in the event i put "when family1 collides with family2" then in the action i put "make hinge between family1 and family2".

Now that the boxes lock into place with one another, the question is: does this mean that hinges keep getting made on every step? Is this going to cause some sort of memory leak?
B
2
G
3
Posts: 52
Reputation: 954

Post » Sat Jun 06, 2009 4:22 pm

[quote="feeblethemighty":1h8j7b4s]Now that the boxes lock into place with one another, the question is: does this mean that hinges keep getting made on every step? Is this going to cause some sort of memory leak?[/quote:1h8j7b4s]

I'm fairly certain it only happens once, but it depends on how you have coded your event. You can check the debugger, but I'm not 100% sure if it counts things like hinges. The only way to really tell if the dubugger doesn't give you any clues is to send your .cap to someone to have a look at, or run your game and leave it overnight and see if it's still working in the morning.... I've done that a few times lol.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Sun Jun 07, 2009 1:01 am

Thanks for the reply!

I checked the debugger and there doesn't seem to be a memory leak or anything (i think). So, i don't think i have to leave it sitting overnight. :) But feel free to check the cap below if you feel so inclined.

http://dl.getdropbox.com/u/1289061/Construct/match3.cap
(You can move the white ball around with the arrow keys or the mouse. It's only a temporary way of testing collisions)

Like colours will attach to each other, but i still don't know of a good way of grouping them so i can perform actions on the group as a whole. Any ideas?
B
2
G
3
Posts: 52
Reputation: 954

Post » Sun Jun 07, 2009 9:30 am

Just a note, if you destroy an object, anything to do with it - behaviors or things you added to it, like hinges) should be removed automatically. It shouldn't be possible to cause a memory leak, without doing something like adding to a hash table/creating loads of objects (and not destroying them). If you come across a leak, make sure you report it.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests