GS Design Patterns
Hi everyone,
I'm new to GS and been wondering if there are established design patterns in place for Game Salad development.
I've seen there are a number of different ways to achieve a specific event, for instance:
"Change the Image of an Actor from Image A to B"
1. You can do this directly inside of an actor through a rule-triggered "Change Image".
2. You can control this same event through a rule-triggered "Change Attibute", which references the "self.image" attribute.
3. You can also control this from another actor through a rule-triggered Game-Level variable.
4. You can also control this through another actor directly through the scene expressions, which allow you to access other actors directly.
Given the many ways to trigger a specific event, is there any established pattern of usage that we can follow? Something like a Model-View-Controller concept?
I'm new to GS and been wondering if there are established design patterns in place for Game Salad development.
I've seen there are a number of different ways to achieve a specific event, for instance:
"Change the Image of an Actor from Image A to B"
1. You can do this directly inside of an actor through a rule-triggered "Change Image".
2. You can control this same event through a rule-triggered "Change Attibute", which references the "self.image" attribute.
3. You can also control this from another actor through a rule-triggered Game-Level variable.
4. You can also control this through another actor directly through the scene expressions, which allow you to access other actors directly.
Given the many ways to trigger a specific event, is there any established pattern of usage that we can follow? Something like a Model-View-Controller concept?
Best Answer
-
AcceleratedGames Posts: 201
I think that a list I made earlier this week will help you answer your question.
http://forums.gamesalad.com/discussion/46652/31-optimization-tips#latest
Answers
It often comes down to a question of resource usage, so certain ways of doing things (e.g. recycling actors vs. spawning & destroying) are preferable, but it can just as easily be a matter of preference (e.g. Change Image works fine unless you need to have image names that match imported images, such as when you want to change an image based on a game-level attribute; see custom font videos, for example).
If you follow someone like @tshirtbooth's videos at GSHelper.com (and featured prominently within these forums), you'll find that his methods are often the best way to achieve something. Other senior members ("line cooks," "sous chefs," and certain members) are just as likely to offer best practices, so feel free to ask about specific needs.