Package com.aqpproject.tools

Examples of com.aqpproject.tools.Vector2D.translate()


    public void action(RaceGameState state, WECar car) {
        if (Singleton.getOptionsController().getRole().equals("SERVER")) {
            String name = "Missile_" + car + "_" + Singleton.getWorldModel().getTime();
            for (int i = 0; i < 3; i++) {
                Vector2D pos = car.getCenter();
                pos.translate(car.getDirection().scale(-12 + 50 + (i == 1 ? 32 : 0)));
                int shift = (7 - 7 * i) * 4;
                pos.translate(car.getRight().scale(shift));
                state.getWorldEntities().put(name + "_" + i, new WEMissile(name + "_" + i, pos, car.getRotation(), car, state));
            }
        }
View Full Code Here


            String name = "Missile_" + car + "_" + Singleton.getWorldModel().getTime();
            for (int i = 0; i < 3; i++) {
                Vector2D pos = car.getCenter();
                pos.translate(car.getDirection().scale(-12 + 50 + (i == 1 ? 32 : 0)));
                int shift = (7 - 7 * i) * 4;
                pos.translate(car.getRight().scale(shift));
                state.getWorldEntities().put(name + "_" + i, new WEMissile(name + "_" + i, pos, car.getRotation(), car, state));
            }
        }
    }
}
View Full Code Here

    @Override
    public void action(RaceGameState state, WECar car) {
        if (Singleton.getOptionsController().getRole().equals("SERVER")) {
            String name = "Mine_" + car + "_" + Singleton.getWorldModel().getTime();
            Vector2D pos = car.getCenter();
            pos.translate(car.getDirection().scale(-16 - 64));
            pos.translate(car.getRight().scale(16));
            state.getWorldEntities().put(name, new WEMine(name, pos, car.getRotation(), car, state));
        }
    }
}
View Full Code Here

    public void action(RaceGameState state, WECar car) {
        if (Singleton.getOptionsController().getRole().equals("SERVER")) {
            String name = "Mine_" + car + "_" + Singleton.getWorldModel().getTime();
            Vector2D pos = car.getCenter();
            pos.translate(car.getDirection().scale(-16 - 64));
            pos.translate(car.getRight().scale(16));
            state.getWorldEntities().put(name, new WEMine(name, pos, car.getRotation(), car, state));
        }
    }
}
View Full Code Here

    @Override
    public void action(RaceGameState state, WECar car) {
        if (Singleton.getOptionsController().getRole().equals("SERVER")) {
            String name = "Bomb_" + car + "_" + Singleton.getWorldModel().getTime();
            Vector2D pos = car.getCenter();
            pos.translate(car.getDirection().scale(-16 + 64));
            pos.translate(car.getRight().scale(16));
            state.getWorldEntities().put(name, new WEBomb(name, pos, car.getRotation(), car, state));
        }
    }
}
View Full Code Here

    public void action(RaceGameState state, WECar car) {
        if (Singleton.getOptionsController().getRole().equals("SERVER")) {
            String name = "Bomb_" + car + "_" + Singleton.getWorldModel().getTime();
            Vector2D pos = car.getCenter();
            pos.translate(car.getDirection().scale(-16 + 64));
            pos.translate(car.getRight().scale(16));
            state.getWorldEntities().put(name, new WEBomb(name, pos, car.getRotation(), car, state));
        }
    }
}
View Full Code Here

     */
    @Override
    public Vector2D getCenter() {
        Vector2D pos = Interpolation.getPositionInterpolation(m_oldPosition, m_position, Singleton.getWorldModel().getInterpolation());
        pos = Singleton.getVisualisation().getDefaultSpriteCenter(m_spriteName).translate(pos);
        pos.translate(getDirection().scale(m_size.x / 2.f));
        pos.translate(getRight().scale(-m_size.y / 2.f));
        return pos;

    }

View Full Code Here

    @Override
    public Vector2D getCenter() {
        Vector2D pos = Interpolation.getPositionInterpolation(m_oldPosition, m_position, Singleton.getWorldModel().getInterpolation());
        pos = Singleton.getVisualisation().getDefaultSpriteCenter(m_spriteName).translate(pos);
        pos.translate(getDirection().scale(m_size.x / 2.f));
        pos.translate(getRight().scale(-m_size.y / 2.f));
        return pos;

    }

    public Vector2D getRealCenter() {
View Full Code Here

        if (m_powerDown) {
            Singleton.getVisualisation().setActorTeint(m_name, new Color(0, 1, 0, 1));
            Singleton.getVisualisation().updateParticleActor(m_name + "_smoke", center.x, center.y, true);
        } else if (m_boost) {
            center.translate(getDirection().scale(-32));
            Singleton.getVisualisation().updateParticleActor(m_name + "_smoke", center.x, center.y, true);
        } else {
            Singleton.getVisualisation().setActorTeint(m_name, new Color(1, 1, 1, 1));
        }
View Full Code Here

        } else {
            Singleton.getVisualisation().setActorTeint(m_name, new Color(1, 1, 1, 1));
        }

        center = getCenter();
        center.translate(getDirection().scale(-32));
        Singleton.getVisualisation().updateParticleActor(m_name + "_durt", center.x, center.y, m_durt);

        Singleton.getVisualisation().updateParticleActor(m_name + "_burn", center.x, center.y, m_shift && Singleton.getPhysics().getLinearVelocity(m_name).length() > 50);

        center = getCenter();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.