How do I sum value of arreys

Get help using Construct 2

Post » Sat Oct 17, 2015 8:14 am

Here you go

Did this quick.
Used function, with local variables ;) Something different ;)

Stores Total stars in global variable totalstars... so just display it where you want. or look at it in debugger to see it in action.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,728

Post » Sat Oct 17, 2015 9:19 am

thanks brother
thank you very much it really gud feeling getting problem solved
i was about from two weeks in this point
thank you once again
Image
B
72
S
42
G
48
Posts: 688
Reputation: 34,392

Post » Sat Oct 17, 2015 9:53 am

No problem. Sorry I didn't give it too you straight off the bat :)
Good you did a little practice.
Reason it didn't work is cause you add 1 to totalvalue when you needed to add total of each current value and not 1
I see I typed that too, so my bad, but I was doing it out of head - lol.

Anyways, functions are great. Now learn how to pass info via param and that single function could possibly find total stars, stars for specific level, etc etc etc
Functions are most powerful part of C2.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,728

Previous

Return to How do I....?

Who is online

Users browsing this forum: max2612, R0J0hound, spiralmc and 32 guests