Package invaders101.entities

Examples of invaders101.entities.BaseEntity


        if (AlienBonusShip.getBonusAlienCount() > 0) {
            return;
        }
        millisToNextBonus -= delta;
        if (millisToNextBonus <= 0) {
            BaseEntity bounusAlien = new AlienBonusShip(
                    this, 50, 50,
                    0.1f + randomGenerator.nextFloat() * 0.05f);
            this.resetBonusTimer();
            this.addEntity(bounusAlien);
        }
View Full Code Here


        alienCount = 0;
        //Separaciones en X e Y entre las naves enemigas
        int separationX = 50, separationY = 45;
        for (int row = 0; row < 3; row++) { //3
            for (int x = 0; x < 11; x++) { //11
                MovingGameEntity alien = new AlienEntity(this, 100 + (x * separationX), (100) + row * separationY);
                entities.add(alien);
                alienCount++;
            }
        }
    }
View Full Code Here

    private void moveAliensForward() {
        if (logicRequiredThisLoop) {
            AlienEntity.revertGroupDirection();
            for (BaseEntity entity : entities) {
                if (entity instanceof AlienEntity) {
                    AlienEntity alien = (AlienEntity) entity;
                    alien.moveForward();
                }
            }
            logicRequiredThisLoop = false;
        }
    }
View Full Code Here

        if (AlienBonusShip.getBonusAlienCount() > 0) {
            return;
        }
        millisToNextBonus -= delta;
        if (millisToNextBonus <= 0) {
            BaseEntity bounusAlien = new AlienBonusShip(
                    this, 50, 50,
                    0.1f + randomGenerator.nextFloat() * 0.05f);
            this.resetBonusTimer();
            this.addEntity(bounusAlien);
        }
View Full Code Here

        // if a game event has indicated that game logic should
        // be resolved, cycle round every entity requesting that
        // their personal logic should be considered.
        if (logicRequiredThisLoop) {
            for (int i = 0; i < entities.size(); i++) {
                BaseEntity entity = entities.get(i);
                entity.update(delta);
            }
            logicRequiredThisLoop = false;
        }
        sprite.update(delta);
    }
View Full Code Here

        // if a game event has indicated that game logic should
        // be resolved, cycle round every entity requesting that
        // their personal logic should be considered.
        if (logicRequiredThisLoop) {
            for (int i = 0; i < entities.size(); i++) {
                BaseEntity entity = entities.get(i);
                entity.update(delta);
            }
            logicRequiredThisLoop = false;
        }
        sprite.update(delta);
    }
View Full Code Here

        // if a game event has indicated that game logic should
        // be resolved, cycle round every entity requesting that
        // their personal logic should be considered.
        if (logicRequiredThisLoop) {
            for (int i = 0; i < entities.size(); i++) {
                BaseEntity entity = entities.get(i);
                entity.update(delta);
            }
            logicRequiredThisLoop = false;
        }
        sprite.update(delta);
    }
View Full Code Here

        alienCount = 0;
        //Separaciones en X e Y entre las naves enemigas
        int separationX = 50, separationY = 45;
        for (int row = 0; row < 3; row++) { //3
            for (int x = 0; x < 11; x++) { //11
                MovingGameEntity alien = new AlienEntity(this, 100 + (x * separationX), (100) + row * separationY);
                entities.add(alien);
                alienCount++;
            }
        }
    }
View Full Code Here

     * a  ambas entidades que una colision a ocurrido.
     */
    private void computeCollisions() {
        for (int p = 0; p < entities.size(); p++) {
            if (entities.get(p) instanceof MovingGameEntity) {
                MovingGameEntity entity1 = (MovingGameEntity) entities.get(p);
                for (int s = p + 1; s < entities.size(); s++) {
                    if (entities.get(s) instanceof MovingGameEntity) {
                        MovingGameEntity entity2 = (MovingGameEntity) entities.get(s);
                        if (entity1.isCollidingWith(entity2)) {
                            entity1.notifyCollisionWith(entity2);
                            entity2.notifyCollisionWith(entity1);
                        }
                    }
                }
            }
        }
View Full Code Here

     * Cada entidad se añadirá a la lista general de las entidades en el juego.
     */
    protected void initEntities() {
        // crea la nave del jugador y la coloca en el centro de la pantalla

        ship = new ShipEntity(this, SCREEN_WIDTH / 2, SCREEN_HEIGHT - 50);
        ship.init();

        entities.add(ship);

        //crea un bloque de aliens
View Full Code Here

TOP

Related Classes of invaders101.entities.BaseEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.