Jigsaw puzzle game

0 favourites
  • 3 posts
From the Asset Store
An amazing and interesting puzzle game for kids!
  • Hi everyone,

    This is my first post. <img src="smileys/smiley9.gif" border="0" align="middle" />

    Would be Construct 2 a good tool to make jigsaw puzzle games?

    I consider this requirements for a basic jigsaw puzzle:

    1) drag and drop pieces;

    2) when the piece is near at right place it just snaps to right position;

    3) count time and pieces left;

    I made my first attempts last night. It was easy to do 1) and 3). But I am not satisfied with my solution to 2), it works but it's ugly.

    I would like to hear from you guys how would you do that.

    Thanks in advance

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One way to do the piece snapping would be to have each piece store its correct position in two private variables - something like 'correctX' and 'correctY' would do.

    Then, when you release the piece with the mouse, check the distance between the piece's actual position and correct position using the distance() expression in the system object. If the distance is within some set tolerance - say, 10 to 20 pixels - set the piece's position to the correct position.

    Be sure to let me know if I need to clarify any further. I hope this helps. :)

  • Linkman, that is a good approach. At least is more elegant than mine, that way I could store positions at a database. I am not used yet with Array and Ajax at Construct2 but it would be quite easy, right?

    My approach was: for each piece, I would have an invisible copy in another layer, and it would check with the sprite overlapping condition.

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