Package com.aqpproject.worldmodel.game.entity

Source Code of com.aqpproject.worldmodel.game.entity.WEWrongDirection

/*
* AQP Project
* http://http://code.google.com/p/aqp-project/
* Alexandre Gomez - Clément Troesch - Fabrice Latterner
*/
package com.aqpproject.worldmodel.game.entity;

import com.aqpproject.game.Singleton;
import com.aqpproject.tools.Vector2D;

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

    public WEWrongDirection(String name, String spriteName, Vector2D pos, float rotation, int frame) {
        super(name, spriteName, pos, rotation, frame, true, true);

        Vector2D size = Singleton.getVisualisation().getSpriteSize(m_spriteName);
        Vector2D screen = Singleton.getVisualisation().getResolution();
        m_position.x = (screen.x - size.x) / 2;
        m_position.y = screen.y - size.y;

        Singleton.getVisualisation().setActorAlpha(m_name, 1.f);
        Singleton.getVisualisation().updateActorFrame(m_name, 2);

    }

    public void setWrongDirection(boolean value) {
        if (value) {
            Singleton.getVisualisation().updateActorFrame(m_name, 1);
        } else {
            Singleton.getVisualisation().updateActorFrame(m_name, 2);
        }
    }
}
TOP

Related Classes of com.aqpproject.worldmodel.game.entity.WEWrongDirection

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.