[solved] move, remove and shift sprites

  • I'm trying to do something like this

    <img src="http://dl.dropbox.com/u/34375299/Construct%202/move.gif" border="0" />

    With LMB you are able to pick and move sprite around the screen, when you release LMB sprite goes back to previous/original position.

    <img src="http://dl.dropbox.com/u/34375299/Construct%202/shift.gif" border="0" />

    When You press RMB on it, sprite is deleted and all others on the right side will jump/shift/slide/whatever to the left, to fill the gap.

    First part and half of the second part of this behavior I managed to do without any problems. The problem on my side is that i cannot properly pick and move those sprites on the right.

    I'm using few different sprites as one family with few variables.

    Most important family variable is "sprite_index" which lets my position these sprites in a single row (from left 0 to 5).

    Not using Array and any other thing.

    Any help appreciated :)

  • Hey Shinkan,

    What about if you had an invisible box that covered the last four blocks, this would allow you to target all the boxes you need with "is overlapping", then you could just use bullet movement to shift them.

    Bit crude perhaps but should work.

  • Forgot to mention in post above, You can pick, move and delete any of these sprites. That second sprite moving/removing is for showing only.

    You can remove first one, second, third.... or all.

    Now if I think about it, it's more less like inventory engine.

  • Ok, I just solve that problem.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Shinkan,

    Any possibility you can share your discovery. I would like to implement something like this as well. I would like to be able to drag and object anywhere, and wait a second or so, and then on release the object should move, bounce, or slide, back into its original position.

  • As i managed to do that i though i implement it into a simple adventure game...well not a game, one room demo

    test

    I' cannot give you my capx now, cause i'm out of town and can't get to my pc :/

    remind me on monday and i will post it

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