How do I loop correctly through a 2d array?

Get help using Construct 2

Post » Wed Jul 01, 2015 5:36 pm

because obviously i am doing it wrong ;)

I have a 2d Array with a width of 20 and a height of 4 and it has random values from 0 to x: http://prntscr.com/7nly9m
When it's not 0 then I want to display an image with the correct id (product id = value in array). This works all fine. The correct images are being shown but for some reason it multiplies them several times. As you can see here: http://prntscr.com/7nlz0e

Here is the code: http://prntscr.com/7nlz4m

Thanks for your help!
B
12
S
3
Posts: 211
Reputation: 1,477

Post » Wed Jul 01, 2015 7:06 pm

This is running every tick. Move it into "On start of layout" if you just want it run once.
ImageImageImage
B
71
S
22
G
247
Posts: 3,753
Reputation: 137,552


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests