[solved] move, remove and shift sprites

Get help using Construct 2

Post » Fri Aug 17, 2012 2:47 am

I'm trying to do something like this



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



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 :)shinkan2012-08-17 14:52:00
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Fri Aug 17, 2012 1:44 pm

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.
ImageImage
B
73
S
16
G
6
Posts: 1,038
Reputation: 10,473

Post » Fri Aug 17, 2012 2:12 pm

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.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Fri Aug 17, 2012 2:51 pm

Ok, I just solve that problem.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Fri Aug 17, 2012 4:55 pm

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.
B
20
S
2
Posts: 257
Reputation: 2,431

Post » Fri Aug 17, 2012 5:59 pm

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
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, michaelverdi and 18 guests