Package net.sf.jiga.xtended.impl

Examples of net.sf.jiga.xtended.impl.AnimationHandler


        return model.GLgetCurrentAnim();
    }

    public Point getModelPaintLocation(int resolution) {
        Point location = getModelDefaultPaintLocation(resolution);
        AnimationHandler currentAnim = getCurrentAnimation();
        if (currentAnim == null) {
            return location;
        }
        int currentSprite = currentAnim.getPosition();
        String animName = getCurrentAnimName();
        double scale = SpritesChar.RES_FACTORS_map.get(resolution) / SpritesChar.RES_FACTORS_map.get(model.res);
        AffineTransform resTx = new AffineTransform();
        if (currentAnim.getMirrorOrientation() == Sprite.HORIZONTAL) {
            resTx.scale(-1, 1);
        }
        if (animName instanceof String) {
            int i;
            if (locationsMap.containsKey(i = model.anim(animName))) {
View Full Code Here


        return location;
    }

    public Rectangle[] getCollisionBounds(SortedMap<Integer, SortedMap<Integer, Vector<Rectangle>>> collisionBoundsMap, int resolution) {
        Rectangle[] bounds = new Rectangle[]{};
        AnimationHandler currentAnim = getCurrentAnimation();
        if (currentAnim == null) {
            return bounds;
        }
        int currentSprite = currentAnim.getPosition();
        String animName = getCurrentAnimName();
        Point location = getModelDefaultPaintLocation(resolution);
        double scale = SpritesChar.RES_FACTORS_map.get(resolution) / SpritesChar.RES_FACTORS_map.get(model.res);
        AffineTransform resTx = new AffineTransform();
        if (currentAnim.getMirrorOrientation() == Sprite.HORIZONTAL) {
            resTx.translate(model.getWidth(resolution), 0);
            resTx.scale(-1, 1);
        }
        if (collisionBoundsMap instanceof SortedMap && animName instanceof String) {
            int i;
View Full Code Here

    public String toString() {
        return toString(false);
    }

    public String toString(final boolean shortDesc) {
        AnimationHandler currentAnimation = getCurrentAnimation();
        if (currentAnimation instanceof AnimationGLHandler) {
            String s = "*" + (currentAnimation.getPlayerStatus() == Animation.PLAYING ? ">" : "-") + "* Fighter " + (attrs.containsKey("player") ? attrs.get("player") : "");
            s += ((getFIGHTERMACHINESTATE() & FIGHTERMACHINE_A) != 0 ? " is attacking" : (getFIGHTERMACHINESTATE() & FIGHTERMACHINE_D) != 0 ? " is defending" : (getFIGHTERMACHINESTATE() & FIGHTERMACHINE_NA) != 0 ? " takes no action" : " is not machine");
            try {
                if (!shortDesc) {
                    s += "\n || facing : " + (hasOpponentsAtLeft() ? "left" : "") + (hasOpponentsAtRight() ? "right" : "");
                    s += "\n || on screen res. factor = " + SpritesChar.RES_FACTORS_map.get(player.gui.getModelResolution());
                    s += "\n || on scene position = "
                            + "\n || " + pos;
                    s += "\n || current move : " + getCurrentAnimName();
                    s += "\n || current frame : " + (currentAnimation instanceof AnimationHandler ? currentAnimation.getPosition() : "n/a");
                    Map<Integer, Map<String, Object>> coll = calcCollision();
                    Map<String, Object> r = new HashMap<String, Object>();
                    s += "\n || colliding box : ";
                    if (coll.containsKey(FIGHTERMACHINE_A)) {
                        r = coll.get(FIGHTERMACHINE_A);
View Full Code Here

TOP

Related Classes of net.sf.jiga.xtended.impl.AnimationHandler

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.