Skip to content

Instantly share code, notes, and snippets.

@veeneck
Created September 8, 2014 17:00
Show Gist options
  • Select an option

  • Save veeneck/d7386c8f4752b64ef349 to your computer and use it in GitHub Desktop.

Select an option

Save veeneck/d7386c8f4752b64ef349 to your computer and use it in GitHub Desktop.
Formation to describe how the squad should arrange themselves.
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