private void parsePointLight(TiledMap tiledMap) {

        RayHandler ray = DevRandEngine.getInstance().gamePhysics().getRayhandler();
        //Tmx code in alpha

        MapLayer layer = tiledMap.getLayers().get("Atrezzo");
        MapObjects objects;
        if (layer != null) {
            objects = layer.getObjects();
 
        } else {
            return;
        }

        for (MapObject obj : objects) {

            boolean light = Boolean.parseBoolean((String) obj.getProperties().get("light"));
            if (light == true) {
                String lightColor = (String) obj.getProperties().get("lightColor");
                float color[] = new float[4];
                List<String> asList = Arrays.asList(lightColor.split("\\s*,\\s*"));
                for (int i = 0; i < asList.size(); ++i) {
                    color[i] = Float.parseFloat(asList.get(i));
                }

                final float lightDistance = Float.parseFloat((String) obj.getProperties().get("lightDistance"));
                Vector2 coord = ((RectangleMapObject) obj).getRectangle().getCenter(new Vector2());

                float offsetx = UtilsEngine.parseFloat((String) obj.getProperties().get("offsetx"));
                float offsety = UtilsEngine.parseFloat((String) obj.getProperties().get("offsety"));

                final PointLight a = new PointLight(ray, 128, new Color(color[0], color[1], color[2], color[3]), lightDistance, coord.x + offsetx, coord.y + offsety);
                ConstantEngine ce = ConstantEngine.getInstance();
                short colisions = (short) ((short) 0xFFFF & ~ce.getShortConstant("CATEGORY_NOCOLLIDABLE")) ;
                PointLight.setContactFilter((short)0x8, (short) 0, colisions );
                
                if (Boolean.parseBoolean((String) obj.getProperties().get("dancingLight"))) {
                    final float periode = UtilsEngine.parseFloat((String) obj.getProperties().get("dancingPeriode"));
                    final float minDistances = UtilsEngine.parseFloat((String) obj.getProperties().get("dancingMinDistance"));
                    Timer.schedule(new Timer.Task() {
                        @Override
                        public void run() {
                            PointLight light = a;
                            float distance = lightDistance;
                            light.setDistance(MathUtils.random( minDistances, distance));
                        }
                    }, 0, periode);
                    
                    
                }
            }
        }
    }