Suggestion: Array functions: += and -= and *=

Discussion and feedback on Construct 2

Post » Mon May 09, 2016 3:46 pm

My current project involves a lot of manipulation of arrays. Say I want to increment an array, I need to do:

X: currx
y: curry
set value: array.at(currx,curry) + 1

I would like to be able to do += 1 or -= 1 or *= 0.99 or similar operations to help simplify my code and reduce the chance of errors. When currx and curry themselves are the values of an array stuff can get very messy and I may accidentally use the wrong currx and curry.
B
10
S
2
G
2
Posts: 73
Reputation: 1,044

Post » Tue May 10, 2016 3:05 pm

?
Just use a combination of local variables and functions?
Also use the comment functionality of C2 to keep track of what's what.
B
36
S
18
G
11
Posts: 248
Reputation: 8,694


Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests