Created
September 8, 2014 17:00
-
-
Save veeneck/d7386c8f4752b64ef349 to your computer and use it in GitHub Desktop.
Formation to describe how the squad should arrange themselves.
This file contains hidden or 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
| import SpriteKit | |
| class Formation { | |
| // The vectors for a 3x3 formation. | |
| var positions : Array<CGVector> = [ | |
| CGVectorMake(0, 0), | |
| CGVectorMake(-64, 0), | |
| CGVectorMake(64, 0), | |
| CGVectorMake(-64, 64), | |
| CGVectorMake(0, 64), | |
| CGVectorMake(64, 64), | |
| CGVectorMake(-64, -64), | |
| CGVectorMake(0, -64), | |
| CGVectorMake(64, -64) | |
| ] | |
| init() { | |
| } | |
| func getVectorAtPosition(position:Int) -> CGVector { | |
| return self.positions[position] | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment