Permalink
Browse files

Cosmetic change

  • Loading branch information...
1 parent 88ea6a5 commit f2dbcb686cd1092490f232a7300e9b2201c48a91 Impaler committed Feb 11, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 star-assault/src/net/obviam/starassault/view/WorldRenderer.java
@@ -20,6 +20,7 @@
private static final float CAMERA_WIDTH = 10f;
private static final float CAMERA_HEIGHT = 7f;
+ private static final float RUNNING_FRAME_DURATION = 0.06f;
private World world;
private OrthographicCamera cam;
@@ -70,15 +71,15 @@ private void loadTextures() {
for (int i = 0; i < 5; i++) {
walkLeftFrames[i] = atlas.findRegion("bob-0" + (i + 2));
}
- walkLeftAnimation = new Animation(0.1f, walkLeftFrames);
+ walkLeftAnimation = new Animation(RUNNING_FRAME_DURATION, walkLeftFrames);
TextureRegion[] walkRightFrames = new TextureRegion[5];
for (int i = 0; i < 5; i++) {
walkRightFrames[i] = new TextureRegion(walkLeftFrames[i]);
walkRightFrames[i].flip(true, false);
}
- walkRightAnimation = new Animation(0.1f, walkRightFrames);
+ walkRightAnimation = new Animation(RUNNING_FRAME_DURATION, walkRightFrames);
}
@@ -100,7 +101,7 @@ private void drawBlocks() {
private void drawBob() {
Bob bob = world.getBob();
- bobFrame = bobIdleLeft;
+ bobFrame = bob.isFacingLeft() ? bobIdleLeft : bobIdleRight;
if(bob.getState().equals(State.WALKING)) {
bobFrame = bob.isFacingLeft() ? walkLeftAnimation.getKeyFrame(bob.getStateTime(), true) : walkRightAnimation.getKeyFrame(bob.getStateTime(), true);
}

0 comments on commit f2dbcb6

Please sign in to comment.