I set a demo up using Kwik and used Peach P’s Newbie tutorial for making objects drag-able. Good. But. My “stones” seem to absorb one another if they touch. That’s not good. Also, I’d like to move on to finishing the “puzzle.” The player needs to place the stones in the proper “holes.” Right now the “stones” can be dragged to the holes. I’m thinking the best strategy is to define an x.y. for the stones as “set” then something happens… Any help is appreciated.
1 – Code created by Kwik - Copyright: kwiksher.com
2 module(…, package.seeall)
3
4 function new()
5 local numPages = 2
6 local menuGroup = display.newGroup()
7 _G.kwk_readMe = 0;
8 local curPage = 1
9
10 local disposeAudios
11
12 local disposeTweens
13 local Stonethree
14 local Stonetwo
15 local Stoneone
16 local backgroundandho
17
18 local drawScreen = function()
19 backgroundandho = display.newImageRect( “p1_backgroundandho.png”, 982, 662 );
20 backgroundandho.x = 475; backgroundandho.y = 319; backgroundandho.alpha = 1
21 menuGroup:insert(backgroundandho)
22 menuGroup.backgroundandho = backgroundandho
23
24 Stoneone = display.newImageRect( “p1_Stoneone.png”, 117, 109 );
25 Stoneone.x = 235; Stoneone.y = 445; Stoneone.alpha = 1
26 menuGroup:insert(Stoneone)
27 menuGroup.Stoneone = Stoneone
28
29 Stonetwo = display.newImageRect( “p1_Stonetwo.png”, 121, 109 );
30 Stonetwo.x = 422; Stonetwo.y = 445; Stonetwo.alpha = 1
31 menuGroup:insert(Stonetwo)
32 menuGroup.Stonetwo = Stonetwo
33
34 Stonethree = display.newImageRect( “p1_Stonethree.png”, 117, 109 );
35 Stonethree.x = 634; Stonethree.y = 445; Stonethree.alpha = 1
36 menuGroup:insert(Stonethree)
37 menuGroup.Stonethree = Stonethree
38
39 local function dragstoneone (event)
40 Stoneone.x = event.x
41 Stoneone.y = event.y
42 end
43 Stoneone:addEventListener (“touch”, dragstoneone)
44
45 local function dragstonetwo (event)
46 Stonetwo.x = event.x
47 Stonetwo.y = event.y
48 end
49 Stonetwo:addEventListener (“touch”, dragstonetwo)
50
51 local function dragstonethree (event)
52 Stonethree.x = event.x
53 Stonethree.y = event.y
54 end
55 Stonethree:addEventListener (“touch”, dragstonethree)
56
[import]uid: 57860 topic_id: 13006 reply_id: 313006[/import]