Actors and Tables/Arrays: good for multiple actors?
mhedges
Raised on VCSMember Posts: 634
Hello -
I am looking for some input concerning actors, specifically multiple actors with the same attributes, and whether tables/arrays are the way to go.
For example, i want to spawn two actors that share the same characteristics - say, two red cars. When I select both, they destroy, like a Memory card game. I could subsequently spawn them again for future use.
Would a table be the way to go? For example, assign the actor types to rows, and their attributes to columns, then referencing the tables.
Comments are welcome. Thanks!
Comments
If you are making a match-3 game where position matters (matches have to be along a line) then tables are imperative. But if you are just making a memory type game then there is no need for tables. Keep track of the current color with a game attribute and also keep track of the order of the clicks/taps and have the actors check the game attribute when two clicks/taps have been made to see if they match that color.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Tables have better macro-view editing, but take more time to code.
If your game has only a few rules, but will need a lot of adjustment for balancing, or has a lot of attributes per actor, tables are definitely preferable.
If you only have one or two attributes per actor, and the main balance problems are in the rules, just using Game Tab attributes may be more manageable and less time consuming.
A Memory Card Game sounds like a lot of actors with few attributes. At a minimum, I can easily see making a table for the list of Symbols the cards will pair-up using. Whether or not you also need a table for the position attributes of where those cards will be is another matter. There's a lot of ways to do that. I can imagine methods which do and don't need tables.
Thanks to both for the replies.
I was wondering if the tables were the way to go, since I'd eventually spawn new actors with the same characteristics as those destoy
My Blog / App Store / Google Play
...as those destroyed. Sorry, I accidentally hit Post.
My Blog / App Store / Google Play