GS Slowing down with random, non-repeating images

rabbigarfinkelrabbigarfinkel Member Posts: 39
edited December 2011 in Working with GS (Mac)
Hello,

I've made a game in which the player has to recognize U.S. Presidents from displayed pictures.  I only want each president to be displayed once.  My current solution uses 44 boolean attributes and disables each picture after it is used once.  This works fine for about thirty seconds or so.  But then the game starts to slow down unacceptably once fewer and fewer presidents are available.  I realize that the Obj-C solution to this is a mutable array and removeObjectAtIndex, but that's not an option yet in GameSalad.  Is there another GS method that wouldn't be so slow?

Thanks,

Eli

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Hey There my guess is you have a bunch of large images you are cycling through. If thats the case then its no surprise you are slowing down and I would not doubt even crashing as you flip through these large images quickly. each new image loads takes more ram. and if your flipping through them faster than GS can dump the old memory well there you. go also the Newest builds preview modes seem to be very resource heavy so no doubt even on the mac it will become and issue.

    My recommendation is find a way to use smaller image dimensions. If the full screen back ground is the same and you just have a presidents face slapped on to 44 copies of that back ground then separate them and have one background actor and then 44 separate images of the faces with smaller image dimensions.

    Hope that helps get you on the right track of finding your issues.

    Cheers
    Aaron
  • CloudsClouds Member Posts: 1,599
    Maybe . . .

    Do you use a random number generator that produces a number then checks whether than number has been used before (ie: has it's 'been used' attribute switched to true) ?
  • MotherHooseMotherHoose Member Posts: 2,456
    edited December 2011
    also, instead of Change Image Behavior … use Change Attribute: [exp] self.Image To:
    seems to speed up the flow and mayhap take the old image out of RAM

    MH
  • rabbigarfinkelrabbigarfinkel Member Posts: 39
    Great answers, thanks to all!
Sign In or Register to comment.