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
    // Use this for initialization
    public override void Start()
    {
        if(ImmunityCombatManager.instance.stage_name.Equals("stomach"))
        {
            level = new StomachLevel();
            background = level.getBackground ();
            mid = level.getMid ();
            foreground = level.getForeground ();
            animation = level.getAnimations();
        }
        else if(ImmunityCombatManager.instance.stage_name.Equals("lung"))
            level = new LungLevel();
        else
            level = new BrainLevel();
        AddChild(level);

        FSoundManager.StopMusic();
        FSoundManager.UnloadAllSoundsAndMusic();
        FSoundManager.PlayMusic("battle_music", .204f);

        FSprite enemy_headshot = new FSprite("punchy_headshot");
        enemy_headshot.x = Futile.screen.halfWidth - enemy_headshot.width/2.0f - 50.0f;
        enemy_headshot.y = Futile.screen.halfHeight - enemy_headshot.height/2.0f - 50.0f;
        enemy_healthbar_ = new HealthBar();
        enemy_healthbar_.scaleX = -.8f;
        enemy_healthbar_.x = enemy_headshot.x - enemy_headshot.width/2.0f - 25.0f;
        enemy_healthbar_.y = enemy_headshot.y;
        enemy_ = new EnemyCharacter(enemy_healthbar_);
        if(ImmunityCombatManager.instance.stage_name.Equals("lung") ||
            ImmunityCombatManager.instance.stage_name.Equals("brain"))
            enemy_.y = -Futile.screen.halfHeight*.27f;

        AddChild(enemy_);

        FSprite player_headshot = new FSprite("hero_headshot");
        player_headshot.scale = .2f;
        player_headshot.x = -Futile.screen.halfWidth + player_headshot.width/2.0f + 50.0f;
        player_headshot.y = Futile.screen.halfHeight - player_headshot.height/2.0f - 50.0f;
        player_healthbar = new HealthBar();
        player_healthbar.scaleX = .8f;
        player_healthbar.x = player_headshot.x + player_headshot.width/2.0f + 25.0f;
        player_healthbar.y = player_headshot.y;
        player_ = new PlayerCharacter(player_healthbar);
        if(ImmunityCombatManager.instance.stage_name.Equals("lung") ||
            ImmunityCombatManager.instance.stage_name.Equals("brain"))
            player_.y = -Futile.screen.halfHeight*.5f;

        playerContainer = new FContainer();
        //Debug.Log ("the player is at " + playerPosition.x + "," + playerPosition.y);

        playerContainer.AddChild (player_);

        //make the camera follow the player
        ImmunityCombatManager.instance.camera_.follow (playerContainer);

        AddChild(playerContainer);

        bacteriaContainer_ = new FContainer();
        AddChild(bacteriaContainer_);

        bubbleContainer_ = new FContainer();
        AddChild(bubbleContainer_);

        dyingBacteriaHolder_ = new FContainer();
        AddChild(dyingBacteriaHolder_);

        ImmunityCombatManager.instance.camera_.follow(playerContainer);
        AddChild(player_headshot);
        AddChild(player_healthbar);
        AddChild(enemy_headshot);
        AddChild(enemy_healthbar_);

        level_bounding_box = new Rect(-Futile.screen.halfWidth*.9f, Futile.screen.halfHeight*.9f, Futile.screen.halfWidth*1.8f, Futile.screen.halfHeight*1.8f);
    }
예제 #3
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);
        }
    }