User Tag List

Results 1 to 4 of 4

Thread: Array and sum

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Mar 2010
    Location
    Lier, Norway
    Posts
    276
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Array and sum

    Hi :-)

    Is there (an easy) way to sum values in an array?
    For example sum 1,1-1,200.
    (in my game I want to keep track of the highscore of each of the 200 levels)

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Mar 2010
    Location
    Lier, Norway
    Posts
    276
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Think I got it.

    - Start loop "score" 201 times
    - on loop score > add valueatxy("array",1,loop index("score")) to total score

    Haven't tried it on the iPhone yet though..

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That'd be how you do it, and it should work on iPhone.
    Just remember that when you start the "score" loop, you set total score to 0. Otherwise each time it runs it will just keep adding.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Mar 2010
    Location
    Lier, Norway
    Posts
    276
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Eliyahu View Post
    That'd be how you do it, and it should work on iPhone.
    Just remember that when you start the "score" loop, you set total score to 0. Otherwise each time it runs it will just keep adding.
    Yes, it worked great on the iPhone too.. and I will remember that, thanks! =)

Similar Threads

  1. Dynamic Array - Sort 2 dimension array by Column 1
    By Ryan in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 16th December 2012, 04:54 AM
  2. Array... help!
    By Aasland in forum iOS Export Module Version 2.0
    Replies: 10
    Last Post: 12th April 2012, 01:14 AM
  3. Dynamic Array to Binary Array problems
    By BREK in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 22nd March 2010, 10:48 PM
  4. Array help
    By Zabooza in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 21st April 2009, 03:02 AM
  5. [Request] Array of array - possible for $$$
    By Blizna in forum Extension Development
    Replies: 9
    Last Post: 29th December 2007, 11:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •