Drag and Drop Issue with actor sticking together
I checked the forums before and found something 2 years ago. My issue is when I drag an actor over an other actor it sticks together. Joe from firemaplegames already answered this question but I really don't understand how to implement in my project.
This is what he wrote
"i would set a global boolean attribute called "isDragging" or something like that.
Leave it FALSE by default.
Only be able to pick up an object when isDragging is FALSE.
As soon as you pick up an object, set isDragging to TRUE.
As soon as you drop an object, set it back to FALSE."
If someone could please send a screen shot how to do this that would be great.
Also how can I upload my project to view in gamesalad. Im not ready to upload to the app store.
This is what he wrote
"i would set a global boolean attribute called "isDragging" or something like that.
Leave it FALSE by default.
Only be able to pick up an object when isDragging is FALSE.
As soon as you pick up an object, set isDragging to TRUE.
As soon as you drop an object, set it back to FALSE."
If someone could please send a screen shot how to do this that would be great.
Also how can I upload my project to view in gamesalad. Im not ready to upload to the app store.
Comments
set up an Index attribute and named it "Drag"
then I made 2 rules for the simple drag and drop
rule
when touch is pressed
change attribute self.Drag = 1
otherwise self.Drag = 0
rule 2
when attribute self.Drag = 1
constrain self.position.x to mouse position.x
constrain self.position.y to mouse position.y
Then I made a .isDragging (boolean) in the game area
followed by another .isDragging in the actor.
Then I made 3 other rules
Rule
when touch is pressed
change attribute self.isdragging to true
Rule
when touch is released
change attribute self.isdragging to false
rule
when attribute game.isdragging = true
constrain self.position.x to mouse position.x
constrain self.position.y to mouse position.y
I did the same for both actor actor and actor 2. So in total I had 5 rules. Is that correct.
Thanks alot for your help but it is not exactly what I was after. I think alot of people have had a similar problem in the past but not been answered. The reason why I added the 2 rules was because I didn't realise the code did the same job as what you sent in the demo. The best example I can show you is a free app from the app store called "shape puzzle HD Free". If you can help that would be great.
The game is an educational jigsaw puzzle. The pieces can overlap without sticking together.
I really appreciate everyones help on this forum and don't want to rock the boat by sounding ungrateful.
Chris
Cheers
Chris