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; }
/** @param values will be appended to the array. * @return a new DelayedRemovalArray with the passed values. * @param <Type> type of stored elements. */ public static <Type> DelayedRemovalArray<Type> newDelayedRemovalArray(final Iterable<? extends Type> values) { final DelayedRemovalArray<Type> array = new DelayedRemovalArray<Type>(); for (final Type value : values) { array.add(value); } return array; }
/** @param forClass class of stored elements. * @param values will be appended to the array. * @return a new typed DelayedRemovalArray with the passed values. * @param <Type> type of stored elements. */ public static <Type> DelayedRemovalArray<Type> newDelayedRemovalArray(final Class<Type> forClass, final Iterable<? extends Type> values) { final DelayedRemovalArray<Type> array = new DelayedRemovalArray<Type>(forClass); for (final Type value : values) { array.add(value); } return array; }
public Level(Viewport viewport) { this.viewport = viewport; gigaGal = new GigaGal(Constants.DEFAULT_SPAWN_LOCATION, this); platforms = new Array<Platform>(); enemies = new DelayedRemovalArray<Enemy>(); bullets = new DelayedRemovalArray<Bullet>(); explosions = new DelayedRemovalArray<Explosion>(); powerups = new DelayedRemovalArray<Powerup>(); // TODO: Initialize the exit portal with its default location exitPortal = new ExitPortal(Constants.EXIT_PORTAL_DEFAULT_LOCATION); }
public Level(Viewport viewport) { this.viewport = viewport; gigaGal = new GigaGal(Constants.DEFAULT_SPAWN_LOCATION, this); platforms = new Array<Platform>(); enemies = new DelayedRemovalArray<Enemy>(); bullets = new DelayedRemovalArray<Bullet>(); explosions = new DelayedRemovalArray<Explosion>(); powerups = new DelayedRemovalArray<Powerup>(); exitPortal = new ExitPortal(Constants.EXIT_PORTAL_DEFAULT_LOCATION); }
public Level(Viewport viewport) { this.viewport = viewport; gigaGal = new GigaGal(Constants.DEFAULT_SPAWN_LOCATION, this); platforms = new Array<Platform>(); enemies = new DelayedRemovalArray<Enemy>(); bullets = new DelayedRemovalArray<Bullet>(); explosions = new DelayedRemovalArray<Explosion>(); powerups = new DelayedRemovalArray<Powerup>(); }
@Override public void create() { batch = new SpriteBatch(); viewport = new ExtendViewport(100, 100); // TODO: Set startTime using TimeUtils.nanoTime() startTime = TimeUtils.nanoTime(); Array<TextureRegion> walkLoopTextures = new Array<TextureRegion>(); // TODO: Add walk-1-right.png to walkLoopTextures walkLoopTextures.add(new TextureRegion(new Texture("walk-1-right.png"))); // TODO: Add walk-2-right.png to walkLoopTextures walkLoopTextures.add(new TextureRegion(new Texture("walk-2-right.png"))); // TODO: Add walk-3-right.png to walkLoopTextures walkLoopTextures.add(new TextureRegion(new Texture("walk-3-right.png"))); // TODO: Initialize walkLoop with a new animation in LOOP_PINGPONG mode // Use WALK_LOOP_FRAME_DURATION walkLoop = new Animation(WALK_LOOP_FRAME_DURATION, walkLoopTextures, PlayMode.LOOP_PINGPONG); Array<TextureRegion> explosionTextures = new Array<TextureRegion>(); explosionTextures.add(new TextureRegion(new Texture("explosion-large.png"))); explosionTextures.add(new TextureRegion(new Texture("explosion-medium.png"))); explosionTextures.add(new TextureRegion(new Texture("explosion-small.png"))); explosion = new Animation(EXPLOSION_FRAME_DURATION, explosionTextures, PlayMode.NORMAL); explosions = new DelayedRemovalArray<OneShotAnimation>(); }
public Level(Viewport viewport) { this.viewport = viewport; gigaGal = new GigaGal(Constants.DEFAULT_SPAWN_LOCATION, this); platforms = new Array<Platform>(); enemies = new DelayedRemovalArray<Enemy>(); bullets = new DelayedRemovalArray<Bullet>(); explosions = new DelayedRemovalArray<Explosion>(); powerups = new DelayedRemovalArray<Powerup>(); // TODO: Initialize the exit portal with its default location }
@Override protected DelayedRemovalArray create (boolean ordered, int capacity, Class type) { return new DelayedRemovalArray(ordered, capacity, type); }
public DelayedRemovalArray<Enemy> getEnemies() { return enemies; }
private void initializeDebugLevel() { gigaGal = new GigaGal(new Vector2(15, 40), this); platforms = new Array<Platform>(); enemies = new DelayedRemovalArray<Enemy>(); platforms.add(new Platform(15, 100, 30, 20)); Platform enemyPlatform = new Platform(75, 90, 100, 65); enemies.add(new Enemy(enemyPlatform)); platforms.add(enemyPlatform); platforms.add(new Platform(35, 55, 50, 20)); platforms.add(new Platform(10, 20, 20, 9)); }
/** @param values will be appended to the array. * @return a new DelayedRemovalArray with the passed values. * @param <Type> type of stored elements. */ public static <Type> DelayedRemovalArray<Type> newDelayedRemovalArray(final Type... values) { return new DelayedRemovalArray<Type>(values); }
/** @param array will be copied. * @return a new delayed removal array created with the passed array values. * @param <Type> type of stored elements. */ public static <Type> DelayedRemovalArray<Type> toDelayedRemoval(final Array<? extends Type> array) { return new DelayedRemovalArray<Type>(array); }
public void init() { icicleList = new DelayedRemovalArray<Icicle>(false, 100); // TODO: Set icicles dodged count to zero iciclesDodged = 0; }
public void init() { icicleList = new DelayedRemovalArray<Icicle>(false, 100); iciclesDodged = 0; }
public void init() { icicleList = new DelayedRemovalArray<Icicle>(false, Constants.INITIAL_ICICLES_ARRAY_CAPACITY); iciclesDodged = 0; }
public void init() { // TODO: Initialize the DelayedRemovalArray icicleList = new DelayedRemovalArray<Icicle>(false, 100); }
public void init() { icicleList = new DelayedRemovalArray<Icicle>(false, 100); }
/** @return a new, empty DelayedRemovalArray. * @param <Type> type of stored elements. */ public static <Type> DelayedRemovalArray<Type> newDelayedRemovalArray() { return new DelayedRemovalArray<Type>(); }
private void initializeDebugLevel() { gigaGal = new GigaGal(new Vector2(15, 40), this); platforms = new Array<Platform>(); bullets = new DelayedRemovalArray<Bullet>(); enemies = new DelayedRemovalArray<Enemy>(); platforms.add(new Platform(15, 100, 30, 20)); Platform enemyPlatform = new Platform(75, 90, 100, 65); enemies.add(new Enemy(enemyPlatform)); platforms.add(enemyPlatform); platforms.add(new Platform(35, 55, 50, 20)); platforms.add(new Platform(10, 20, 20, 9)); }
private void initializeDebugLevel() { gigaGal = new GigaGal(new Vector2(15, 40), this); exitPortal = new ExitPortal(new Vector2(150, 150)); platforms = new Array<Platform>(); bullets = new DelayedRemovalArray<Bullet>(); enemies = new DelayedRemovalArray<Enemy>(); explosions = new DelayedRemovalArray<Explosion>(); powerups = new DelayedRemovalArray<Powerup>(); platforms.add(new Platform(15, 100, 30, 20)); Platform enemyPlatform = new Platform(75, 90, 100, 65); enemies.add(new Enemy(enemyPlatform)); platforms.add(enemyPlatform); platforms.add(new Platform(35, 55, 50, 20)); platforms.add(new Platform(10, 20, 20, 9)); powerups.add(new Powerup(new Vector2(20, 110))); }
public DelayedRemovalArray<Powerup> getPowerups() { return powerups; }