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
21
G
221
Posts: 3,649
Reputation: 124,227


Return to How do I....?

Who is online

Users browsing this forum: DarkRoomGames, mekonbekon, NadeemAbbass and 10 guests