Package res.elements

Examples of res.elements.Block


        Common.info(7,"level.init () fine");
    }
    int i;
    public void addBlock(String type,float x,float y)
    {
        Block b=new Block();
        b.setPosition(x/2,y);
        b.setBoxShape(0.5f,1.0f);
        if(type=="x")
        {
            //b.setSize(0.5f,1.1f);
            b.setStaticSprite("res/elements/block/blockm.png");
            //b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            addElement(b);
        }
        if(type=="y")
        {
            //b.setSize(0.5f,1.1f);
            b.setStaticSprite("res/elements/block/blockm.png");
            //b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            b.bodydef.type=BodyType.DYNAMIC;
            //addElement(b);
        }
        if(type=="b")
        {
            b.setBoxShape(0.5f,0.5f);
            b.setStaticSprite("res/elements/boxino.png");
            //b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            addElement(b);
        }
        if(type=="S")
        {
            ElementSpawnPoint s = new ElementSpawnPoint();
            s.setPosition(x/2,y);
            addElement(s);
        }
        if(type=="[")
        {
            //b.setSize(0.3f,1.1f);
            b.setStaticSprite("res/elements/block/blockl.png");
            //  b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            //b.friction=0;
            addElement(b);
        }
        if(type=="]")
        {
            //b.setSize(0.3f,1.1f);
            //  b.friction=0;
            b.setStaticSprite("res/elements/block/blockr.png");
            //    b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            addElement(b);
        }
        if(type=="|")
        {
            //  b.friction=0;
            //b.setSize(0.25f,1.1f);
            b.setStaticSprite("res/elements/block/blockcr.png");
            //  b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            addElement(b);
        }
        if(type=="A")
        {
            //b.setSize(0.25f,1.1f);
            b.setStaticSprite("res/elements/block/blockctl.png");
            //  b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            addElement(b);
        }
        if(type=="B")
        {
            //b.setSize(0.25f,1.1f);
            b.setStaticSprite("res/elements/block/blockctr.png");
            //s    b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            addElement(b);
        }
        if(type=="C")
        {
            //b.setSize(0.25f,1.1f);
            b.setStaticSprite("res/elements/block/blockcbr.png");
            //b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            addElement(b);
        }
        if(type=="D")
        {
            //b.setSize(0.25f,1.1f);
            b.setStaticSprite("res/elements/block/blockcbl.png");
            //b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            addElement(b);
        }

        if(type=="a")
        {
            //b.setSize(0.25f,1.1f);
            Ammo a = new Ammo();
            a.setStaticSprite("res/elements/gun.png");
            a.setPosition(x/2,y);
            //  a.friction=0;
            //b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            addElement(a);
        }
        if(type=="h")
        {
            Health a = new Health();
            a.setStaticSprite("res/elements/h.png");
            a.setPosition(x/2,y);
            //  a.friction=0;
            //b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            addElement(a);
        }

        if(type=="^")
        {
            Thorn a = new Thorn();
            a.setStaticSprite("res/elements/triangle.png");

            a.setPosition(x/2,y);
            //  a.friction=0;
            //b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            addElement(a);
        }
        if(type=="~")
        {
            Platform a = new Platform();
            a.setStaticSprite("res/elements/elevator.png");
            a.getCurrentSpriteSet().get(0).offsety = -0.08f;
            a.setPosition(x/2,y);
            a.setBoxShape(1.5f,0.2f);

            a.centralPosition = new Vec2(x/2,y);
            //a.friction=0;
            //b.getCurrentSpriteSet().get(0).offsety = -0.1f;
            addElement(a);
        }
        b.getCurrentSpriteSet().get(0).offsety=-0.2f;


        //i++;
        //System.out.println("i:"+i+" "+type);
    }
View Full Code Here

TOP

Related Classes of res.elements.Block

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.