Parsing out sprite creation?

Get help using Construct 2

Post » Wed Oct 16, 2013 7:06 pm

Hey all. I've been working on a roguelike. I've been trying to make the largest map possible. The issue is. When I create all the tiles, i use "(array)for each X,Y element"-create object. That works fine for anything around 25,000 elements(tiles), but anymore then that just crashes the browser window. I tested creating the same sprites every tick or even repeat loop(20) each tick and i can get 65,000 tiles before i get bored. lol. so I think what is obviously crashing the browser is creating them all at once. Basically, anyone have any ideas as to how to parse out the tile creation in a "(array)for each X,Y"?? Thanks!
B
25
S
4
G
1
Posts: 47
Reputation: 1,723

Post » Wed Oct 16, 2013 10:12 pm

bump
B
25
S
4
G
1
Posts: 47
Reputation: 1,723

Post » Thu Oct 17, 2013 4:02 pm

anyone?
B
25
S
4
G
1
Posts: 47
Reputation: 1,723

Post » Thu Oct 17, 2013 10:08 pm

What if you build your own 'For' loop to process the array, handling a specific chunk each time it runs?

Looks like this:


@Kcpunk666 - Here's a capx with those events + a text output to serve as a visual indication:
https://www.dropbox.com/s/7dt74da3e81zvyn/iterating_array_loop.capxScavengrove2013-10-17 22:32:58
B
7
S
1
Posts: 20
Reputation: 388

Post » Fri Oct 18, 2013 12:46 am

I did figure out a way breaking up the big array and copying the data into 4 small chunk arrays. and chaining the object creation for each chuck. I like your example though. It seems a bit easier to change and tweak. Much appreciation. I've learned some stuff from it for sure.
B
25
S
4
G
1
Posts: 47
Reputation: 1,723


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, dop2000 and 48 guests