Which way saved more ram?

cptongsgcptongsg Member Posts: 70
edited November -1 in Working with GS (Mac)
Hi, I have 5 actor with difference action. Each time when a touch is execute, it change to another actor with difference action. Will it be advisable to spawn & destroy actor on the same position or will it be better to change image & attribute in one actor. The one actor will be heavily code vs Spawn & destroy. Which is better? Thks!

Comments

  • synthesissynthesis Member Posts: 1,693
    Why not swap the X and Y with a different actor off screen?
  • cptongsgcptongsg Member Posts: 70
    sorry, how do I swap? off screen do u mean in invisible mode? thks!
  • synthesissynthesis Member Posts: 1,693
    You would need to use a combination of actor ID attributes and some game attributes to track actor states and X and Y positions.

    here is a thread about making unique actor ID setups
    http://gamesalad.com/forums/topic.php?id=4297

    It would be an elaborate setup to some degree but not too difficult...it would take thought and planning but it would be lighter on the game engine than spawning.

    But spawning would be the easiest way.
  • cptongsgcptongsg Member Posts: 70
    Wow that something i never come across! You are the MAN! Thanks, Thanks & thankS!
  • JGary321JGary321 Member Posts: 1,246
    There's a lot of variables to this one. Some questions I ask myself when deciding to spawn or move:

    What is the weight of the actor?? `If it is an actor with a lot of rules move wins. If it only has a few spawn wins.`

    How often will you use this actor? `If it's something that will be used a lot, move wins. If not spawn.`

    How much action is going on, on screen? `If there is a lot going on a one time, move wins. If not spawn.`

    Sometimes adding the rules to recycle an actor are more trouble than it's worth. You are adding more rules, so the weight of the actor goes up. Thereby increasing your TOTAL ram usage, which is very important. Again there are a lot of variables in whether to spawn or move, only you can decide what's right for your game. But hopefully this gives thought into it & will help you.

    JGary
  • cptongsgcptongsg Member Posts: 70
    Thks JGary!
Sign In or Register to comment.