Package com.aqpproject.tools

Examples of com.aqpproject.tools.Vector2D


    }

    @Override
    public void updateActorTransform() {
        super.updateActorTransform();
        Vector2D pos = getCenter();
//        pos.translate(getDirection().scale(-16));

        Singleton.getVisualisation().updateParticleActor(m_name + "_smoke", pos.x, pos.y, true);
    }
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

        if (m_isActive) {
//            m_lastVelocity = m_lastVelocity.reflection(new Vector2D(normal.y, normal.x));
            //Singleton.getPhysics().setLinearVelocity(m_name, m_lastVelocity);

            m_lastVelocity = m_lastVelocity.reflection(new Vector2D(normal.y, normal.x));
            Vector2D back = m_lastVelocity.normalize().scale(-10);

            Singleton.getPhysics().resetBody(m_name, m_position.translate(back), m_lastVelocity.scale(100), m_rotation);


            m_boundsCount++;
View Full Code Here

* @author Clément
*/
public class WEMissile extends WorldPhysicEntity {

    public WEMissile(String name, Vector2D pos, float rotation, WECar emitter, RaceGameState state) {
        super(name, "missile", pos, rotation, new Vector2D(23, 14), 0, 0, 0, 1);
        m_emitter = emitter;
        Vector2D velocity = emitter.getLinearVelocity().translate(getDirection().scale(300.f));
        Singleton.getPhysics().setLinearVelocity(name, velocity);
        m_state = state;
        Singleton.getVisualisation().createParticleActor(m_name + "_smoke", "missile", m_position.x, m_position.y, true);
        try {
            Singleton.getAudioController().playSound("tirer", false);
View Full Code Here

    }

    @Override
    public void updateActorTransform() {
        super.updateActorTransform();
        Vector2D pos = getCenter();
        //pos.translate(getDirection().scale(-16));

        Singleton.getVisualisation().updateParticleActor(m_name + "_smoke", pos.x, pos.y, true);
    }
View Full Code Here

* @author Clément
*/
public class WEMiniMap extends WorldEntity {

    public WEMiniMap(String mapSpriteName) {
        super("MiniMapBackground", "MiniMapBackground", new Vector2D(), 0, 1, true, true);

        Vector2D size = Singleton.getVisualisation().getSpriteSize(m_spriteName);
        Vector2D screen = Singleton.getVisualisation().getResolution();
        int shift = 20;

        m_position.x = screen.x - size.x;
        m_position.y = screen.y - size.y - shift;

        //Singleton.getVisualisation().setActorAlpha(m_name, 0.4f);

        //Entities
        m_entities = new HashMap<>();

        m_mapSpriteName = mapSpriteName;
        Vector2D mapSize = Singleton.getVisualisation().getSpriteSize(m_mapSpriteName);
        m_mapShift = new Vector2D(size).translate(-mapSize.x, -mapSize.y).scale(0.5f);

        Singleton.getVisualisation().createActor("MiniMap", m_mapSpriteName, m_position.x + m_mapShift.x, m_position.y + m_mapShift.y, 0, 1, true, true);

    }
View Full Code Here

    }

    @Override
    public void update(long time) {
        for (String s : m_entities.keySet()) {
            Vector2D pos = m_entities.get(s).getCenter();
            pos = pos.scale(1.f / 16.f).translate(m_position).translate(m_mapShift);
            Singleton.getVisualisation().updateActor(s + "_mini", pos.x, pos.y, 0);
        }
    }
View Full Code Here

* @author Clement
*/
public class WECountdown extends WorldEntity {

    public WECountdown() {
        super("Countdown", "Countdown", new Vector2D(), 0, 1, true, true);
        m_started = false;
        m_finished = false;
        m_raceStarted = false;
        m_c1 = true;
        m_c2 = true;
        m_cgo = true;
        Vector2D size = new Vector2D(Singleton.getVisualisation().getSpriteSize(m_spriteName));
        m_position = new Vector2D(Singleton.getVisualisation().getResolution()).scale(0.5f);
        m_position.translate(-size.x / 2f, -size.y / 2f);
        Singleton.getVisualisation().updateActor(m_name, m_position.x, m_position.y, 0);
        try {
            Singleton.getAudioController().playSound("c3", false);
        } catch (ParserConfigurationException | SAXException | IOException ex) {
View Full Code Here

            }
            m_miniaturesList.removeAll(m_miniaturesList);
            int x = 128;
            int y = (int) Singleton.getVisualisation().getResolution().y - 20 - 64;
            for (Item it : m_itemList) {
                m_miniaturesList.add(new WEItemMini("mini_" + m_miniaturesList.size(), m_miniatures.get(it.getType().toString()), new Vector2D(x, y), 0, 1));
                x += 64;
            }
        }
    }
View Full Code Here

* @author Clément
*/
public class WEInformations extends WorldEntity {

    public WEInformations(int nbLaps) {
        super("Informations", "Informations", new Vector2D(), 0, 1, true, true);
        m_nbLaps = nbLaps;

        Vector2D size = Singleton.getVisualisation().getSpriteSize(m_spriteName);
        Vector2D screen = Singleton.getVisualisation().getResolution();
        int shift = 20;
        m_position.x = 0;
        m_position.y = screen.y - size.y - shift;

        float height = Singleton.getVisualisation().getResolution().y;
View Full Code Here

TOP

Related Classes of com.aqpproject.tools.Vector2D

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.