Java Code Examples for com.badlogic.gdx.utils.viewport.ExtendViewport

The following examples show how to use com.badlogic.gdx.utils.viewport.ExtendViewport. These examples are extracted from open source projects. 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 Project: ud405   Source File: IciclesScreen.java    License: MIT License 6 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    // TODO: Initialize the HUD viewport
    hudViewport = new ScreenViewport();

    // TODO: Initialize the SpriteBatch
    batch = new SpriteBatch();

    // TODO: Initialize the BitmapFont
    font = new BitmapFont();

    // TODO: Give the font a linear TextureFilter
    font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);

    player = new Player(iciclesViewport);
    icicles = new Icicles(iciclesViewport);

    // TODO: Set top score to zero
    topScore = 0;
}
 
Example 2
Source Project: ud405   Source File: IciclesScreen.java    License: MIT License 6 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    hudViewport = new ScreenViewport();
    batch = new SpriteBatch();

    font = new BitmapFont();
    font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);

    player = new Player(iciclesViewport);
    // TODO: Initialize icicles with the difficulty
    icicles = new Icicles(iciclesViewport);

    topScore = 0;
}
 
Example 3
Source Project: ud405   Source File: IciclesScreen.java    License: MIT License 6 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    hudViewport = new ScreenViewport();
    batch = new SpriteBatch();

    font = new BitmapFont();
    font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);

    player = new Player(iciclesViewport);
    icicles = new Icicles(iciclesViewport, difficulty);

    Gdx.input.setInputProcessor(this);

    topScore = 0;
}
 
Example 4
Source Project: ud406   Source File: Level.java    License: MIT License 6 votes vote down vote up
public Level() {
    viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    gigaGal = new GigaGal(new Vector2(50, 50), this);
    platforms = new Array<Platform>();
    enemies = new DelayedRemovalArray<Enemy>();
    bullets = new DelayedRemovalArray<Bullet>();
    explosions = new DelayedRemovalArray<Explosion>();
    powerups = new DelayedRemovalArray<Powerup>();
    exitPortal = new ExitPortal(new Vector2(200, 200));

    gameOver = false;
    victory = false;
    score = 0;


}
 
Example 5
Source Project: ud405   Source File: IciclesScreen.java    License: MIT License 6 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    hudViewport = new ScreenViewport();
    batch = new SpriteBatch();

    font = new BitmapFont();
    font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);

    player = new Player(iciclesViewport);
    icicles = new Icicles(iciclesViewport, difficulty);

    Gdx.input.setInputProcessor(this);

    topScore = 0;
}
 
Example 6
Source Project: ud406   Source File: Level.java    License: MIT License 6 votes vote down vote up
public Level() {
    viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    gigaGal = new GigaGal(new Vector2(50, 50), this);
    platforms = new Array<Platform>();
    enemies = new DelayedRemovalArray<Enemy>();
    bullets = new DelayedRemovalArray<Bullet>();
    explosions = new DelayedRemovalArray<Explosion>();
    powerups = new DelayedRemovalArray<Powerup>();
    exitPortal = new ExitPortal(new Vector2(200, 200));

    gameOver = false;
    victory = false;
    score = 0;


}
 
Example 7
Source Project: ud406   Source File: Level.java    License: MIT License 6 votes vote down vote up
public Level() {
    viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    gigaGal = new GigaGal(new Vector2(50, 50), this);
    platforms = new Array<Platform>();
    enemies = new DelayedRemovalArray<Enemy>();
    bullets = new DelayedRemovalArray<Bullet>();
    explosions = new DelayedRemovalArray<Explosion>();
    powerups = new DelayedRemovalArray<Powerup>();
    exitPortal = new ExitPortal(new Vector2(200, 200));

    gameOver = false;
    victory = false;
    score = 0;


}
 
Example 8
Source Project: ud406   Source File: Level.java    License: MIT License 6 votes vote down vote up
public Level() {
    viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    gigaGal = new GigaGal(new Vector2(50, 50), this);
    platforms = new Array<Platform>();
    enemies = new DelayedRemovalArray<Enemy>();
    bullets = new DelayedRemovalArray<Bullet>();
    explosions = new DelayedRemovalArray<Explosion>();
    powerups = new DelayedRemovalArray<Powerup>();
    exitPortal = new ExitPortal(new Vector2(200, 200));

    gameOver = false;
    victory = false;
    score = 0;


}
 
Example 9
Source Project: ud406   Source File: Level.java    License: MIT License 6 votes vote down vote up
public Level() {
    viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    gigaGal = new GigaGal(new Vector2(50, 50), this);
    platforms = new Array<Platform>();
    enemies = new DelayedRemovalArray<Enemy>();
    bullets = new DelayedRemovalArray<Bullet>();
    explosions = new DelayedRemovalArray<Explosion>();
    powerups = new DelayedRemovalArray<Powerup>();
    exitPortal = new ExitPortal(new Vector2(200, 200));

    gameOver = false;
    victory = false;
    score = 0;


}
 
Example 10
Source Project: ud406   Source File: GameplayScreen.java    License: MIT License 6 votes vote down vote up
@Override
    public void show() {
        AssetManager am = new AssetManager();
        Assets.instance.init(am);

        batch = new SpriteBatch();
        gameplayViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

        // TODO: Comment out the debug level
//        level = new Level(gameplayViewport);
//        level.initializeDebugLevel();

        // TODO: Ask the LevelLoader to load Level1
        level = LevelLoader.load("Level1", gameplayViewport);
        chaseCam = new ChaseCam(gameplayViewport.getCamera(), level.getGigaGal());
    }
 
Example 11
Source Project: ud406   Source File: Level.java    License: MIT License 6 votes vote down vote up
public Level() {
    viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    gigaGal = new GigaGal(new Vector2(50, 50), this);
    platforms = new Array<Platform>();
    enemies = new DelayedRemovalArray<Enemy>();
    bullets = new DelayedRemovalArray<Bullet>();
    explosions = new DelayedRemovalArray<Explosion>();
    powerups = new DelayedRemovalArray<Powerup>();
    exitPortal = new ExitPortal(new Vector2(200, 200));

    gameOver = false;
    victory = false;
    score = 0;


}
 
Example 12
Source Project: ud406   Source File: Level.java    License: MIT License 6 votes vote down vote up
public Level() {
    viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    gigaGal = new GigaGal(new Vector2(50, 50), this);
    platforms = new Array<Platform>();
    enemies = new DelayedRemovalArray<Enemy>();
    bullets = new DelayedRemovalArray<Bullet>();
    explosions = new DelayedRemovalArray<Explosion>();
    powerups = new DelayedRemovalArray<Powerup>();
    exitPortal = new ExitPortal(new Vector2(200, 200));

    gameOver = false;
    victory = false;
    score = 0;


}
 
Example 13
Source Project: ud406   Source File: Level.java    License: MIT License 6 votes vote down vote up
public Level() {
    viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    gigaGal = new GigaGal(new Vector2(50, 50), this);
    platforms = new Array<Platform>();
    enemies = new DelayedRemovalArray<Enemy>();
    bullets = new DelayedRemovalArray<Bullet>();
    explosions = new DelayedRemovalArray<Explosion>();
    powerups = new DelayedRemovalArray<Powerup>();
    exitPortal = new ExitPortal(new Vector2(200, 200));

    gameOver = false;
    victory = false;
    score = 0;


}
 
Example 14
Source Project: ud406   Source File: GameplayScreen.java    License: MIT License 5 votes vote down vote up
@Override
    public void show() {
        AssetManager am = new AssetManager();
        Assets.instance.init(am);

        batch = new SpriteBatch();
        gameplayViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

//        level = new Level(gameplayViewport);
//        level.initializeDebugLevel();

        level = LevelLoader.load("Level1", gameplayViewport);
        chaseCam = new ChaseCam(gameplayViewport.getCamera(), level.getGigaGal());
    }
 
Example 15
Source Project: ud406   Source File: GameplayScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {
    AssetManager am = new AssetManager();
    Assets.instance.init(am);

    batch = new SpriteBatch();
    gameplayViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    level = new Level(gameplayViewport);

    chaseCam = new ChaseCam(gameplayViewport.getCamera(), level.getGigaGal());
}
 
Example 16
Source Project: ud405   Source File: IciclesScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    player = new Player(iciclesViewport);
    icicles = new Icicles(iciclesViewport);

}
 
Example 17
Source Project: ud405   Source File: IciclesScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    player = new Player(iciclesViewport);
    icicle = new Icicle(new Vector2(Constants.WORLD_SIZE / 2, Constants.WORLD_SIZE / 2));

}
 
Example 18
Source Project: ud405   Source File: BallScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE);
    ball = new BouncingBall(viewport);
    Gdx.input.setInputProcessor(ball);
}
 
Example 19
Source Project: ud406   Source File: GameplayScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {
    AssetManager am = new AssetManager();
    Assets.instance.init(am);
    level = new Level();
    batch = new SpriteBatch();
    viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);
}
 
Example 20
Source Project: ud405   Source File: BallScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE);
    ball = new BouncingBall(viewport);
    balls = new Array<BouncingBall>();
    for (int i = 0; i < BALL_COUNT; i++) {
        balls.add(new BouncingBall(viewport));
    }
    Gdx.input.setInputProcessor(this);
}
 
Example 21
Source Project: ud405   Source File: FallingObjectsScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {

    renderer = new ShapeRenderer();
    viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE);
    avalanche = new Avalanche();

}
 
Example 22
Source Project: ud406   Source File: GameplayScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {
    AssetManager am = new AssetManager();
    Assets.instance.init(am);
    level = new Level();
    batch = new SpriteBatch();
    viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);
}
 
Example 23
Source Project: ud406   Source File: GameplayScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {
    AssetManager am = new AssetManager();
    Assets.instance.init(am);
    level = new Level();
    batch = new SpriteBatch();
    viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);
    chaseCam = new ChaseCam(viewport.getCamera(), level.gigaGal);
}
 
Example 24
Source Project: ud405   Source File: BallScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE);
    ball = new BouncingBall(viewport);
    Gdx.input.setInputProcessor(ball);
}
 
Example 25
Source Project: ud405   Source File: IciclesScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    player = new Player(iciclesViewport);
    icicles = new Icicles(iciclesViewport);

}
 
Example 26
Source Project: ud405   Source File: BallScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE);
    ball = new BouncingBall(viewport);
}
 
Example 27
Source Project: ud406   Source File: OnscreenControls.java    License: MIT License 5 votes vote down vote up
public OnscreenControls() {
    this.viewport = new ExtendViewport(
            Constants.ONSCREEN_CONTROLS_VIEWPORT_SIZE,
            Constants.ONSCREEN_CONTROLS_VIEWPORT_SIZE);


    moveLeftCenter = new Vector2();
    moveRightCenter = new Vector2();
    shootCenter = new Vector2();
    jumpCenter = new Vector2();

    recalculateButtonPositions();
}
 
Example 28
Source Project: ud405   Source File: BallScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE);
    ball = new BouncingBall(viewport);
    Gdx.input.setInputProcessor(ball);
}
 
Example 29
Source Project: ud405   Source File: BallScreen.java    License: MIT License 5 votes vote down vote up
@Override
public void show() {
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE);
    ball = new BouncingBall(viewport);
    balls = new Array<BouncingBall>();
    for (int i = 0; i < BALL_COUNT; i++) {
        balls.add(new BouncingBall(viewport));
    }
    Gdx.input.setInputProcessor(this);
}
 
Example 30
Source Project: ud406   Source File: GameplayScreen.java    License: MIT License 5 votes vote down vote up
@Override
    public void show() {
        AssetManager am = new AssetManager();
        Assets.instance.init(am);

        batch = new SpriteBatch();
        gameplayViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

        level = new Level(gameplayViewport);
        level.initializeDebugLevel();

//        level = LevelLoader.load("Level1", gameplayViewport);
        chaseCam = new ChaseCam(gameplayViewport.getCamera(), level.getGigaGal());
    }