Another Grid question

For questions about using Classic.

Post » Sat Apr 16, 2011 3:44 pm

I'm now trying to spawn a series of 50 blocks randomly on my layout that is,

Width = 2150
Height = 12762
Its a 32x32 grid.
But I have failed to write the code that spawns it on the grid consistently.

heres the .Cap

http://www.mediafire.com/?1q7i9hmb09oewm9

In case your wondering its the 2nd line of code.
B
3
G
1
Posts: 20
Reputation: 540

Post » Sat Apr 16, 2011 5:20 pm

Just calculate the positions exactly as you did for the array.

Replace
(int(Random(2150)/48)*48, int(Random(12762)/48)*48)

with
(int(Random(2150)/32)*32 + 16, int(Random(12762)/32)*32 + 16)

That should do it.

btw, I'm experiencing problems with the platform behavior. Framerate drops down to 20-30 fps.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sun Apr 17, 2011 12:50 am

Thanks for the reply, yes the platform behavior is really destroying the frame rate but, I have no idea how to fix it.
B
3
G
1
Posts: 20
Reputation: 540


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests