Hi Everyone, Im new to gideros . In Drag Me Example, I want to prevent from dragging a shape over other shape ( means it will stop when hit other shape ) . How can i implement the code ?
@hgvyas123 unfortunately thats not that easy, if you determine that they collide and stop move them, then you can't also move the figure back from the collided figure, because you will be ignoring all movements.
You also need to take an account the side of collision, the vector, etc.
more and more I started thinking that it might be easier to implement through dragging box2d bodies, unless I'm missing some obvious solution
basically i store position of shape before moving it and later i check whether it collides or not and if they collide i reset shape's position to last stored value
Comments
http://giderosmobile.com/forum/discussion/121/simple-collision-detection/p1
to check for the collision if they collide stop moving them else allow
You also need to take an account the side of collision, the vector, etc.
more and more I started thinking that it might be easier to implement through dragging box2d bodies, unless I'm missing some obvious solution
http://appcodingeasy.com/Gideros-Mobile/Dragging-Box2d-object-in-Gideros-Mobile
Likes: hgvyas123
Likes: ar2rsawseen
Likes: hgvyas123