I'm developing an iOS game, in that, there is a sprite in the form of a circle and a grey shaded box. The circle can be moved across the screen with the finger or mouse but I don't want the circle to overlap the grey box as shown in the below picture. Is there any way to do that. Please help.
This way ?
99Instances2Go Not exactly but it is close to what I asked. Thank you so much for the example. Learned new things.
The problem was solved.
I could solve this problem using one finger. Now, I want the same to happen using two fingers which brings two circles. I defined the same code of one finger for two fingers as well as but I'm not sure where it went wrong, only the circle with one finger is working while the finger with second circle isn't working.
Could you please help me with this? 99Instances2Go
If we had a look at your capx it would be an easy fix. Have you tried duplicating your code used for 1 finger and just simply change the instances as needed for your 2nd circle ???
fr0z3n Yes, I did. Only one circle with finger 1 is working.
Here is the code I used for one finger,
I created a transparent barricade 1 to make the Circle1 to stop at that position
if -> Circle 1 is overlapping Barricade1
-> is in touch -> Circle 1 set position to (Touch.X (0), Circle.Y)
I created barricade 2 to set the Circle1 to position to the finger1. When the finger1 touches the barricade 2, Circle1 will be moving along with finger1.
if -> is in touch
-> touch is touching Barricade2 -> Circle 1 set position to (Touch.X (0), Touch.Y (0))
I used the same technique for Circle2 with finger2 but it is not working, I don't know why.
if -> Circle 2 is overlapping Baricade1
-> is in touch -> Circle 2 set position to (Touch.X (1), Circle.Y)
-> touch is touching Baricade2 -> Circle 2 set position to (Touch.X (1), Touch.Y (1))
Develop games in your browser. Powerful, performant & highly capable.
upload your capx so i can look at it. not sure whats going on with out seeing the capx
fr0z3n Here is the .capx, please check.
fr0z3n Did you get the chance to check the .capx?
Can somebody help me on this?
I don't know if this is what you want? I replaced all your 44 events with a few clean ones which should do the same thing. Or are you looking for something else?
EDIT: Posted wrong link before.
https://dl.dropboxusercontent.com/u/100 ... ouch1.capx