public StomachLevel()
    {
        lake_sprite_ = new FSprite("stomach_back");
        cave_sprite_ = new FSprite("stomach_mid");
        bubbles_container_ = new FParallaxContainer();
        foreground_ = new FSprite("stomach_fore");

        background = new FParallaxContainer();
        stomachCave = new FParallaxContainer();
        foreground = new FParallaxContainer();

        background.AddChild (lake_sprite_);
        stomachCave.AddChild (cave_sprite_);
        foreground.AddChild (foreground_);

        background.setSize (new Vector2 (Futile.screen.width * 1.5f, Futile.screen.height * 1.5f));
        bubbles_container_.setSize(new Vector2 (Futile.screen.width *1.5f, Futile.screen.height * 1.5f));
        foreground.setSize (new Vector2 (Futile.screen.width * 2f, Futile.screen.height * 2f));

        AddChild(background);
        AddChild(stomachCave);
        AddChild(bubbles_container_);
        AddChild(foreground);

        bubble_container_size_ = new Rect(-Futile.screen.halfWidth*.75f, -Futile.screen.halfHeight*.75f, Futile.screen.width*.75f, Futile.screen.halfHeight*.75f);
        stomach_bubbles_ = new List<StomachBubble>();
    }
예제 #2
0
    public BrainLevel()
    {
        background_ = new FSprite("Background");
        //AddChild(background_);
        background = new FParallaxContainer();
        background.AddChild (background_);
        AddChild (background);

        background.setSize (backgroundContainerSize);

        back_neurons_container_ = new FParallaxContainer();
        back_neurons_ = new List<Neuron>();
        back_neurons_area_ = new Rect(-Futile.screen.halfWidth, 0, Futile.screen.width, Futile.screen.halfHeight);
        AddChild(back_neurons_container_);

        back_neurons_container_.setSize (backgroundContainerSize);

        for(int i=0; i<50; i++)
        {
            bool is_fast = (Random.value > .5f);
            float opacity_chance = Random.value;
            Neuron.Opacity opacity;
            if(opacity_chance < .33f)
            {
                opacity = Neuron.Opacity.PERCENT_40;
            }
            else if(opacity_chance < .66f)
            {
                opacity = Neuron.Opacity.PERCENT_60;
            }
            else
            {
                opacity = Neuron.Opacity.PERCENT_80;
            }

            Neuron neuron = new Neuron(is_fast, opacity);

            float x_pos = Random.value*back_neurons_area_.width + back_neurons_area_.xMin;
            float y_pos = Random.value*back_neurons_area_.height + back_neurons_area_.yMin;

            neuron.SetPosition(new Vector2(x_pos, y_pos));

            back_neurons_container_.AddChild(neuron);
            back_neurons_.Add(neuron);

            last_firing_time_ = Time.time;
        }

        foreground_ = new FSprite("Forground");
        //AddChild(foreground_);
        foreground = new FParallaxContainer();
        foreground.AddChild (foreground_);
        AddChild (foreground);

        foreground.setSize (foregroundContainerSize);

        front_neurons_container_ = new FParallaxContainer();
        front_neurons_ = new List<Neuron>();
        front_neurons_area_ = new Rect(-Futile.screen.halfWidth, -Futile.screen.halfHeight, Futile.screen.width, Futile.screen.halfHeight*.5f);
        AddChild(front_neurons_container_);

        front_neurons_container_.setSize(foregroundContainerSize);

        for(int i=0; i<0; i++)
        {
            bool is_fast = (Random.value > .5f);
            float opacity_chance = Random.value;
            Neuron.Opacity opacity;
            if(opacity_chance < .33f)
            {
                opacity = Neuron.Opacity.PERCENT_40;
            }
            else if(opacity_chance < .66f)
            {
                opacity = Neuron.Opacity.PERCENT_60;
            }
            else
            {
                opacity = Neuron.Opacity.PERCENT_80;
            }

            Neuron neuron = new Neuron(is_fast, opacity);

            float x_pos = Random.value*front_neurons_area_.width + front_neurons_area_.xMin;
            float y_pos = Random.value*front_neurons_area_.height + front_neurons_area_.yMin;

            neuron.SetPosition(new Vector2(x_pos, y_pos));

            front_neurons_container_.AddChild(neuron);
            front_neurons_.Add(neuron);
        }
    }