Hello!
Sorry for my bad English!
(I used an automatic translator, and then I tried to correct my text)
I am an inexperienced programmer in "mobile" applications and, until few days.
But, yesterday, I found GIDEROS.
I am creating a simple board game, where the user must touch in some pieces
and then position it on the board (like the "checkers" however more simple)
In CORONA SDK, I was using the "dmc_dragdrop" library, because it
facilitates the movement of the pieces a lot (drag and drop)
Here is two links on that library:
http://docs.davidmccuskey.com/display/docs/Quick+Guide+-+dmc_dragdrop http://developer.coronalabs.com/code/dmc-lib-drag-and-drop Is there some similar library, for GIDEROS ?
Thank you for the attention!
Paulo
Comments
Check this too:
http://appcodingeasy.com/Gideros-Mobile/Dragging-Box2d-object-in-Gideros-Mobile
(I used an automatic translator, and then I tried to correct my text)
Thanks, everyone, for the answers!
Actually, I need something a little more complex.
I would like that, when I move a piece over the board, automatically the nearest square of that piece "attract" (like a magnet) the piece for him. Thus, the user don't need positioning the piece exactly inside the "house".
In Corona SDK, with the "dmc_dragdrop" library that I mentioned above, I got it.
Please watch the video below, with my program running. Notice that the board squares "attract" (pull) the triangular piece for him:
http://www.mediafire.com/?lhlcw9g5i0w0ah8
Thank you very much !
Paulo
And unfortunately you have chosen not the best time to ask for help, since it's a winter holiday, I think no one could really help you by creating a prototype or example for now.
But if you are up to creating the functionality yourself, the idea would be that you store all center coordinates where you could drop your triangle in a table.
And then on mouse up or touch end loop through the table and find the nearest point, which is basic comparing of x and y coordinates.
When you have found the nearest point simply, tween your object to it and that's it
is the triangle an image? If it is then you need to calculate the square that has the maximum portion of the rectangular image (triangle in this example) to determine where it should go. Then when the touch is released, make it tween to the square. To work with squares and board, have a look at these articles,
http://howto.oz-apps.com/2012/11/games-with-grids-tilemaps.html
http://howto.oz-apps.com/2012/12/working-with-grids-part-ii.html
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
With your suggestions, I got it !
Thanks for everybody!
Paulo