Grid movement for multiple objects

For questions about using Classic.

Post » Thu Oct 01, 2009 6:54 pm




When i create multiple objects of the same type and make them solid.

How can i move them all in the same time. Even the one that are blocked (one on the right) when the left block has some space to move.

The pics show how it should work when we press one of the direcional buttons shown over the picture.

Can anyone solve this ? I'm pretty sure there is a way. Maybe with a loop or something.


Oh and an additional question : how to stop the music (ogg) so it doesn't show an error when i close the game?
almost there
B
6
S
2
G
5
Posts: 47
Reputation: 2,024

Post » Thu Oct 01, 2009 7:48 pm

this is simple to do. I made a cap to show you.

http://download319.mediafire.com/3zint3 ... bjects.cap
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Thu Oct 01, 2009 10:50 pm

thanks for the cap, but there is one thing , the objects we move cant overlap themselfs, they have to be also solid. And when there is no space they just stay in the same position without moving on each other.

I have tried to make it and come to exactly the same result as in your cap.


But anyway thanks and sorry for the trouble.
almost there
B
6
S
2
G
5
Posts: 47
Reputation: 2,024

Post » Mon Oct 05, 2009 5:38 am

[quote="pikus":1eryuoqu]Can anyone solve this ? I'm pretty sure there is a way. Maybe with a loop or something.[/quote:1eryuoqu]
I have a solution. But I'm afraid it's very complicated compared to just activate grid movement behavior. On the other hand, my solution doesn't make use of that behavior at all, so you're much more flexible in changing every little bit of it. But be warned, I make use of functions, alias calling, loops and such. I'm nearly sure, there might be an easier way. But hey, it works ;)

[url:1eryuoqu]http://www.mediafire.com/file/znonwyxim3y/Grid%20Movement%20Alternative.cap[/url:1eryuoqu]

Hope it helps! (I know it's not well documented)
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Wed Oct 07, 2009 8:34 am

[quote="tulamide":1y7pgszs][quote="pikus":1y7pgszs]Can anyone solve this ? I'm pretty sure there is a way. Maybe with a loop or something.[/quote:1y7pgszs]
I have a solution. But I'm afraid it's very complicated compared to just activate grid movement behavior. On the other hand, my solution doesn't make use of that behavior at all, so you're much more flexible in changing every little bit of it. But be warned, I make use of functions, alias calling, loops and such. I'm nearly sure, there might be an easier way. But hey, it works ;)

[url:1y7pgszs]http://www.mediafire.com/file/znonwyxim3y/Grid%20Movement%20Alternative.cap[/url:1y7pgszs]

Hope it helps! (I know it's not well documented)[/quote:1y7pgszs]

Wow Tulamide there is some advance stuff you got right there. It took me all day to understand most of your work. good work. this helped me out a lot with the array and function objects, so thank you.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Wed Oct 07, 2009 6:25 pm

Sorry for the late answer : ) It works ! :D

but i will need some time to understand how its done ; P

P.S.if i'll use it somehow you will be in the credits :)
almost there
B
6
S
2
G
5
Posts: 47
Reputation: 2,024

Post » Thu Oct 08, 2009 7:02 pm

You're both welcome :)

And in case of any questions left, don't hesitate to ask or pm. You shouldn't suffer from me being too lazy to document it :mrgreen:
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests