Attempting Match-3 style gameplay with physics

This forum is currently in read-only mode.
From the Asset Store
Match 3
$9.99 USD
Template for a match 3 game, fully documented in comments and video
  • 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?

  • 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?

    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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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?

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)