com.badlogic.gdx.graphics.g2d.Animation Java Examples

The following examples show how to use com.badlogic.gdx.graphics.g2d.Animation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #2
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #3
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #4
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #5
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #6
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #7
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #8
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #9
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public ExitPortalAssets(TextureAtlas atlas) {
    final AtlasRegion exitPortal1 = atlas.findRegion(Constants.EXIT_PORTAL_SPRITE_1);
    final AtlasRegion exitPortal2 = atlas.findRegion(Constants.EXIT_PORTAL_SPRITE_2);
    final AtlasRegion exitPortal3 = atlas.findRegion(Constants.EXIT_PORTAL_SPRITE_3);
    final AtlasRegion exitPortal4 = atlas.findRegion(Constants.EXIT_PORTAL_SPRITE_4);
    final AtlasRegion exitPortal5 = atlas.findRegion(Constants.EXIT_PORTAL_SPRITE_5);
    final AtlasRegion exitPortal6 = atlas.findRegion(Constants.EXIT_PORTAL_SPRITE_6);

    Array<AtlasRegion> exitPortalFrames = new Array<AtlasRegion>();

    // TODO: Add the frames to the exitPortalFrames array
    exitPortalFrames.addAll(exitPortal1, exitPortal2, exitPortal3, exitPortal4, exitPortal5, exitPortal6);

    // TODO: Package the frames into an animation, using the frame duration constant
    // Go define that constant in Constants.java if you haven't already
    exitPortal = new Animation(Constants.EXIT_PORTAL_FRAME_DURATION, exitPortalFrames);
}
 
Example #10
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #11
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #12
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #13
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #14
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #15
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #16
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #17
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #18
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #19
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #20
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #21
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #22
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #23
Source File: SpriteAnimationDrawable.java    From talos with Apache License 2.0 6 votes vote down vote up
public void set(TextureRegion region, int rows, int cols) {
    this.region = region;
    Array<Frame> frames = new Array<>();

    float uSize = (region.getU2()-region.getU())/cols;
    float vSize = (region.getV2()-region.getV())/rows;
    for(int r = 0; r < rows; r++) {
        for(int c = 0; c < cols; c++) {
            Frame frame = new Frame();
            frame.u1 = region.getU() + c * uSize;
            frame.u2 = region.getU() + (c+1) * uSize;
            frame.v2 = region.getV() + r * vSize;
            frame.v1  = region.getV() + (r+1) * vSize; // we are flipping the V's
            frames.add(frame);
        }
    }
    animation = new Animation<>(1f/(rows*cols), frames);
    setAspectRatio(uSize/vSize);
}
 
Example #24
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #25
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #26
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #27
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #28
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #29
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}
 
Example #30
Source File: Assets.java    From ud406 with MIT License 6 votes vote down vote up
public GigaGalAssets(TextureAtlas atlas) {
    standingLeft = atlas.findRegion(Constants.STANDING_LEFT);
    standingRight = atlas.findRegion(Constants.STANDING_RIGHT);
    walkingLeft = atlas.findRegion(Constants.WALKING_LEFT_2);
    walkingRight = atlas.findRegion(Constants.WALKING_RIGHT_2);

    jumpingLeft = atlas.findRegion(Constants.JUMPING_LEFT);
    jumpingRight = atlas.findRegion(Constants.JUMPING_RIGHT);

    Array<AtlasRegion> walkingLeftFrames = new Array<AtlasRegion>();
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_1));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_2));
    walkingLeftFrames.add(atlas.findRegion(Constants.WALKING_LEFT_3));
    walkingLeftAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingLeftFrames, PlayMode.LOOP);

    Array<AtlasRegion> walkingRightFrames = new Array<AtlasRegion>();
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_1));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_2));
    walkingRightFrames.add(atlas.findRegion(Constants.WALKING_RIGHT_3));
    walkingRightAnimation = new Animation(Constants.WALK_LOOP_DURATION, walkingRightFrames, PlayMode.LOOP);
}