add nod during stretch
GitOrigin-RevId: 54f82b43a8c7c7aca419cb98a572e899213f4002
This commit is contained in:
parent
576ac65eb7
commit
7f4ce7e854
@ -86,17 +86,18 @@ namespace Jumpy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Point spritePosition(Pose pose, GameTime time) {
|
private Point spritePosition(Pose pose, GameTime time) {
|
||||||
|
int frameNum = (time.TotalGameTime.Milliseconds / 125) % 4;
|
||||||
|
if (frameNum == 3) {
|
||||||
|
frameNum = 1;
|
||||||
|
}
|
||||||
|
|
||||||
switch (pose) {
|
switch (pose) {
|
||||||
case Pose.Walking:
|
case Pose.Walking:
|
||||||
int frameNum = (time.TotalGameTime.Milliseconds / 125) % 4;
|
|
||||||
if (frameNum == 3) {
|
|
||||||
frameNum = 1;
|
|
||||||
}
|
|
||||||
return new Point(spriteSize * frameNum + spriteSize * 6, 0);
|
return new Point(spriteSize * frameNum + spriteSize * 6, 0);
|
||||||
case Pose.Crouching:
|
case Pose.Crouching:
|
||||||
return new Point(spriteSize * 7, spriteSize * 2);
|
return new Point(spriteSize * 7, spriteSize * 2);
|
||||||
case Pose.Stretching:
|
case Pose.Stretching:
|
||||||
return new Point(spriteSize * 1, spriteSize * 2);
|
return new Point(spriteSize * frameNum, spriteSize * 2);
|
||||||
case Pose.Jumping:
|
case Pose.Jumping:
|
||||||
if (jumpTime > 0.25) {
|
if (jumpTime > 0.25) {
|
||||||
return new Point(spriteSize * 6, spriteSize);
|
return new Point(spriteSize * 6, spriteSize);
|
||||||
|
Loading…
Reference in New Issue
Block a user