move objects in array / Delete all indices above x

Get help using Construct 2

Post » Mon Feb 24, 2014 8:29 pm

Uh, can you tell me what I am doing wrong here?
Image
I am destroying a few cubes, the objects avoce should fall on the position of the deleted cubes and the indices with no objects should be empty but somehow that doesnt work.
(and somehow they stack on eachother or fall below the grid...)
-----
additional info:
function "falling": looks for the cubes above that and moves it down.
x/y - position of
z0: frame of the cube where it looks for the adjacent cubes
z1: uid of cube
z2: destroyed 1 / undestroyed 0
Time21.capx
It should be quite clear if you download the capx :shock:

Yours
Black2key
B
19
S
5
G
5
Posts: 27
Reputation: 4,257

Post » Tue Apr 29, 2014 12:36 am

I've been looking at your .capx and thinking about what you're trying to accomplish, and I think that you need to compose a special Delete Function in the events sheet. This Delete Function would shift the elements towards the end of the array in the Y dimension when an element is deleted. So in your case the Y dimension of the 3D Array is one of those vertical columns of Cubes. And when the Cubes are deleted and there associated coordinates in the Array Plugin have the value set to 0 in the 3rd Dimension, you could have the Delete Function shift all the existing cubes that are displayed above each deleted cube shifted down by 1 in the Y dimension. I'll try to make amendments to your solution to achieve this idea, when I get the chance. But for now hopefully this idea might help you.
B
9
S
2
G
1
Posts: 41
Reputation: 708

Post » Sat May 03, 2014 8:27 am

Hey, @Black2key! I have Capx that is a solution to your problem. I've tried my best to make intuitive modifications to the Event Sheet. I had to modify your Mouse Click Event Group and fully re-write the "falling" function. I put as many comments as I could in. I hope that the comments make sense, and that they will help you understand the logic of the "falling" function.
You do not have the required permissions to view the files attached to this post.
B
9
S
2
G
1
Posts: 41
Reputation: 708


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests