Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

    • CommentAuthordaveh
    • CommentTimeMar 2nd 2011 edited
     
    How can I add an antigravity effect to a sprite that can be moved with drag and drop? I need it to act as an antigravity both when dropped and when being dragged. I have tried adding mouseantigravity when a mouseclick event listener on the sprite is activated and antigravity on the sprites position when dropped, but find that the remove action doesn't work and I end up with antigravitywells all over the stage and a persistant mouseantigravity. I have also tried writting a custom modified class based on the mouseantigravity but using the sprite's postion, but it seems to be beyond my abilities. I am sure there is a fairly simple solution, but I have no idea what it is. Please help !

    Sorted - I used the example shown in "Dynamically move a gravity well". The first time I tried it I set up the change of coordinates wrong so it didn't update each frame. Now it is set out right it works like a dream!