cleanup: spritePosition -> SpritePosition

GitOrigin-RevId: b715b0be5499f41c905257f3b19481a9fd81bf71
This commit is contained in:
Colin McMillen 2020-01-11 09:31:14 -05:00
parent 361a02c67f
commit b169584794

View File

@ -157,7 +157,7 @@ namespace SemiColinGames {
position.X = Math.Max(position.X, 0 + spriteWidth); position.X = Math.Max(position.X, 0 + spriteWidth);
} }
private int spritePosition(Pose pose, GameTime time) { private int SpritePosition(Pose pose, GameTime time) {
int frameNum = (time.TotalGameTime.Milliseconds / 125) % 4; int frameNum = (time.TotalGameTime.Milliseconds / 125) % 4;
if (frameNum == 3) { if (frameNum == 3) {
frameNum = 1; frameNum = 1;
@ -192,7 +192,7 @@ namespace SemiColinGames {
} }
public void Draw(SpriteBatch spriteBatch, Camera camera, GameTime time) { public void Draw(SpriteBatch spriteBatch, Camera camera, GameTime time) {
int index = spritePosition(pose, time); int index = SpritePosition(pose, time);
Rectangle textureSource = new Rectangle(index * spriteSize, 0, spriteSize, spriteSize); Rectangle textureSource = new Rectangle(index * spriteSize, 0, spriteSize, spriteSize);
Vector2 spriteCenter = new Vector2(spriteSize / 2, spriteSize / 2); Vector2 spriteCenter = new Vector2(spriteSize / 2, spriteSize / 2);
SpriteEffects effect = facing == Facing.Right ? SpriteEffects effect = facing == Facing.Right ?