Help: A Puzzle App

Hi,

I just downloaded, seen examples, and studied corona sdk.

I’m planning to create a jigsaw puzzle / tangrams puzzle as my first app for my practice.

I tried to look for sample codes and it seems I cannot find where to start to begin with my app.

The problems I have are:

  • How to rotate a certain image depending on the user’s rotational touch.
  • How to check if a certain piece is on the right location.

Or is it possible for me to achieve this with the current build of corona sdk?

I hope you could point me where to start and where to look for the solution.

thanks so much in advance. cheers! [import]uid: 51389 topic_id: 8922 reply_id: 308922[/import]

You should be able to achieve that with the current build. I recommend you play with it and if you have troubles or errors, then we’re here to discuss them and find a solution together.

Personally, when I first starting to use corona sdk, I have similar doubts. [import]uid: 12455 topic_id: 8922 reply_id: 32587[/import]

yes, teex84 you’re right… I think its possible in the current build… thanks very much for your help.

I have another problem though… this time its about overlapping objects.

When two objects overlap, I want the topmost object to be the only one to be affected on touch event. Currently, with the code that I have when I touch on overlapping objects, both of overlapping objects are affected… And this I don’t want.

I also used the API stage.setFocus(), when I used this the one being affected alone is the object being overlapped (the one behind). And this I don’t want as well. I like the topmost one to be processed. :frowning:

I hope you don’t get tired of helping me…

Thanks in advance. Cheers!
[import]uid: 51389 topic_id: 8922 reply_id: 33171[/import]

@mhelgarc,
have you seen the examples? There is one where there are three objects that can be moved by touch. That is a hint

if you did not quite get that after looking at the code,

it uses insert to place the object on top, so if there are overlaps, bring the current object on the top and your problems shall be resolved - Hopefully.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 8922 reply_id: 33184[/import]

Thank you very much for your reply jayantv. It resolved my problem.

Funny that it was resolved though by not inserting the object on top… but by just adding the “return true” on the touch event listener function.

[lua]-- Important to return true. This tells the system that the event
– should not be propagated to listeners of any objects underneath.
return true[/lua]

just by that, it solved my problem rofl… (from almost a week of frustration)

Without your response it won’t made me to re-look at the Drag Example…

Cheers!!! [import]uid: 51389 topic_id: 8922 reply_id: 33209[/import]