Created
November 8, 2012 12:50
-
-
Save kenpower/4038610 to your computer and use it in GitHub Desktop.
drawing enemies with a moving overhead 2d camera
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
| //drawing enemies with a moving camera | |
| Vector3 cameraPos = new Vector3(-camera.Position.X, -camera.Position.Y, 0); | |
| Matrix cameraTrans = Matrix.CreateTranslation(cameraPos); | |
| spriteBatch.Begin(SpriteSortMode.Immediate, null, null, null, null, null,cameraTrans); | |
| foreach(Sprite s in sprites) | |
| s.Draw(gameTime,spriteBatch, true); | |
| spriteBatch.End(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment