Tough: array and moving objects

Get help using Construct 2

Post » Tue Jul 24, 2012 5:37 am

Hi,

This is the first time ever I'm using arrays and i would like to ask you for help. I have made an array which is taking size of a square and then creates number of smaller squares within that size. And I'm not sure if it's exactly the size of the square but it looks like it is working pretty well. But now I have a problem i have no idea how to solve which is how to make those little square stay on their position simultaneously behaving like the main big square as a whole. Is it even possible? If anyone could help me with that i will highly appreciate it!

Clicking on purple square will create a square from smaller squares based on array. Clicking on "array square" will destroy it.
CAPX

THANKS!

EDIT@ Ok, i think it doesn't have to follow it, only spawn when clicked on the big square but at its angle.

updated capxmegatronx2012-07-24 06:11:11
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Tue Jul 24, 2012 5:40 pm

Here's the math to position on the larger box:
http://dl.dropbox.com/u/5426011/examples13/gridOnRotatedBox.capx
Making the objects follow is as simple as using the pin behavior.
B
79
S
24
G
55
Posts: 4,755
Reputation: 41,273

Post » Tue Jul 24, 2012 7:59 pm

@R0J0hound You're the man! :D thanks! Will test it asap. It will work on spawning objects too, right? megatronx2012-07-24 19:59:49
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Thu Jul 26, 2012 6:14 am

Hey man, do you think you can help me with nailing that down please? It needs a bit more customization and i just cant get it it to work the way it needs to work.

Thanks
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Thu Jul 26, 2012 6:25 pm

[quote]It will work on spawning objects too, right?
[/quote]
I don't quite get what you're asking. Event 2 does the creation and positioning of the smaller objects. You can put it anywhere in your events where you want to create/spawn the small boxes on the big box.
B
79
S
24
G
55
Posts: 4,755
Reputation: 41,273

Post » Fri Jul 27, 2012 1:04 am

That's ok. But i can't get it to work right. How can i customize it so it will fit any size square. I've tried several combinations but it's always breaking when the with of the big square is not 32n. I can send you a cap file.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Fri Jul 27, 2012 7:40 pm

Re-download the example, I made it a bit more generic.
B
79
S
24
G
55
Posts: 4,755
Reputation: 41,273

Post » Fri Jul 27, 2012 9:45 pm

Thanks man! I see i was very close ;)
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910


Return to How do I....?

Who is online

Users browsing this forum: Colludium and 25 guests