Created
January 21, 2015 19:46
-
-
Save tomauty/c9cb43a538e781d988f7 to your computer and use it in GitHub Desktop.
pseudocode for multi-object spawning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Say a constructed object takes three arguments and you dont need to reference them after they're constructed | |
args = [ | |
[ 7, 10, true ] | |
[ 9, 1, true ] | |
[ 4, 6, true ] | |
[ 1, 9, false ] | |
] | |
for (i in args) { | |
// Variables created under here will not be usable outside of the array, so you can't manipulate them once | |
// they're instantiated. But this way you only have one section to modify the arguments. | |
createNewObject(args[i][0], args[i][1], args[i][2]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment