How do I use arrays?

Get help using Construct 2

Post » Wed Aug 26, 2015 2:49 pm

I'm trying to make a snake game and there's this forum post saying use arrays and had a link to the manual, I read the manual section on arrays but its all very confusing to me, how do I use arrays (in general not just with a snake game)? How would it work with a Snake game exactly...?
Posts: 1
Reputation: 208

Post » Wed Aug 26, 2015 2:59 pm

You can use two-dimensional arrays to track the locations of the all of the snake's body parts, saying you have a part at {1,1} and another part at {1,2} and the next part at {1,3} and a tail at {2,3}.

So you would just fill your two-dimensional array with 1s and 0s; 1 meaning snake body, 0 meaning no snake body.

Like this:
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
Posts: 1,419
Reputation: 4,867

Return to How do I....?

Who is online

Users browsing this forum: Tibolli and 4 guests