public CannonBody(Body body, float radius, int direction, float offset, boolean searchLight) { super(body, radius, direction, offset, true, false); bodyType = BODY_TYPE.METAL; float random = MathUtils.random(); if (random < .5f) { image = ResourceFactory.getInstance().getItemImage("cannon1"); type = CANNON_TYPE.SINGLE; weapon = new Gun(); weapon.onPickup(this); } else { image = ResourceFactory.getInstance().getItemImage("cannon2"); type = CANNON_TYPE.DOUBLE; weapon = new Fireball(); weapon.onPickup(this); } if (searchLight) { addLight( LightFactory.getInstance() .getConeLight( getBody().getPosition(), Config.getDimensions().WORLD_WIDTH, 3, Color.RED, startDirection, 2)); light.setSoftnessLength(Config.TILE_SIZE_X); light.setActive(false); light.setStaticLight(false); light.setSoft(false); light.setXray(true); } }