Drag

0 favourites
  • 5 posts
From the Asset Store
Use inertion of your movements to throw, rotate your objects and etc. Objects can interact with others while dragging.g
  • Good evening.

    I'm trying to make a game where you can drag an item onto a character. A dress up game if you will. What exactly can I do to make this happen? I tried mouse clicking and that worked some what until I clicked again and it moved the item another few pixels away.

    Any help would be good.

    Thanks in advanced

    -theCosmicWitch

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Have a look at my Capx here, it uses drag and drop for level making, it may help you.

    http://www.scirra.com/forum/level-creation-capx_topic46125_post288864.html#288864

  • I made this for you:

    dl.dropbox.com/u/23138239/drag%20object.capx

    Clothes will go to a pre defined position when mouse button is released in a -15 to +15 pixels distance on X and Y to that position.

    Now if you want to release it over a moving object than you should make the clothes have a pin behavior and pin them to it in the third and fourth events.

    After that you should set an every tick event activated only when the clothes are in the righ position (you can make that using the system in the third and fourth events or using instance or local variables.

    This event should set the clothes to the character's position on the image points specified for them or you could use some math to set X and Y coordinates by the character's coordinates.

    Hope this isn't confusing a lot, i'm kinda drunk :P

  • lol thanks for the help guys I appreciate it! I'll start working it out now and post if I continue to have issues.

    Cheers

    edit: Works like a charm, thanks again ^^

  • okay I've added new stuff to it, but one of the items runs away from my mouse when I click on it. I'm not sure why it's doing that because I'm pretty sure I have everything in there correctly.

    edit: also I want to know if it's possible to upload an image right into the game so the user can use that image. Like a picture of themselves that they can drag in place of the character's head.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)