Пример #1
0
 public DisappearingPlatforms(int x, int y, int width, int height, Color color, Disappear version)
     : base(x, y, width, height, -1, -1, Movement.None, color)
 {
     direction = Movement.None;
     tint      = color;
     image     = base.image;
     type      = version;
     position  = new Rectangle(x, y, width, height);
 }
Пример #2
0
    private void OnTriggerEnter(Collider other)
    {
        Disappear scriptDisappear = other.GetComponent <Disappear>();

        if (scriptDisappear != null)
        {
            scriptDisappear.IsUnderPlayer = true;
        }
    }
 /// <summary>
 /// Visibility has changed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmPopup_VisibleChanged(object sender, EventArgs e)
 {
     if (frmPopup.Visible)
     {
         Appear?.Invoke(this, EventArgs.Empty);
     }
     else
     {
         Disappear?.Invoke(this, EventArgs.Empty);
     }
 }
Пример #4
0
 protected void Awake()
 {
     rigidbody        = GetComponent <Rigidbody2D>();
     gravitation      = GetComponent <Gravitation>();
     gameController   = GameObject.Find("GameController").GetComponent <GameController>();
     merger           = GetComponentInChildren <Merger>();
     particleCollider = GetComponent <Collider2D>();
     mergeCollider    = merger.GetComponent <Collider2D>();
     emitter          = GetComponent <Emitter>();
     mainRenderer     = GetComponent <SpriteRenderer>();
     auraRenderer     = transform.Find("Aura").GetComponent <SpriteRenderer>();
     detailsRenderer  = transform.Find("Details").GetComponent <SpriteRenderer>();
     hue       = GetComponent <Hue>();
     animator  = GetComponent <Animator>();
     disappear = GetComponent <Disappear>();
 }
Пример #5
0
 // Constructor
 public DisappearingPlatforms(int x, int y, int width, int height, int max, int min, Movement axis, Color color, Disappear version)
     : base(x, y, width, height, max, min, axis, color)
 {
     direction = axis;
     tint      = color;
     image     = base.image;
     type      = version;
     position  = new Rectangle(x, y, width, height);
     //determines where to set max and min and where its moving
     if (axis == Movement.Horizontal)
     {
         movingLeft = true;
         maxX       = max;
         minX       = min;
     }
     else if (axis == Movement.Vertical)
     {
         movingUp = true;
         maxY     = max;
         minY     = min;
     }
 }
Пример #6
0
        private void initSkills()
        {
            SoundEffect booSfx    = LoadingUtils.load <SoundEffect>(content, "QuickShot");
            SoundEffect shriekSfx = LoadingUtils.load <SoundEffect>(content, "Boo");
            SoundEffect whooshSfx = LoadingUtils.load <SoundEffect>(content, "Whoosh");

            SkillFinished appear = delegate() {
                int alpha = 255;
                resetFadeEffect(this.fadeEffect, alpha, FadeEffect.FadeState.PartialIn);
                resetFadeEffect(this.selectedFadeEffect, alpha, FadeEffect.FadeState.PartialIn);
                this.state = State.Visisble;
            };
            SkillFinished disappear = delegate() {
                int alpha = 75;
                resetFadeEffect(this.fadeEffect, alpha, FadeEffect.FadeState.PartialOut);
                resetFadeEffect(this.selectedFadeEffect, alpha, FadeEffect.FadeState.PartialOut);
                this.state = State.Invisible;
                this.observerHandler.notifyGhostChange(this);
            };

            SkillFinished shriek = delegate() {
                int alpha = 255;
                resetFadeEffect(this.fadeEffect, alpha, FadeEffect.FadeState.PartialIn);
                resetFadeEffect(this.selectedFadeEffect, alpha, FadeEffect.FadeState.PartialIn);
                this.state = State.Visisble;

                float effectLife;
                Base2DSpriteDrawable shockWave = ModelGenerationUtil.generateWaveEffect(content, base.Position, Color.Orange, out effectLife);
                VisualEffect         effect    = new VisualEffect(shockWave, effectLife);
                EffectsManager.getInstance().Visuals.Add(effect);
            };

            SkillFinished boo = delegate() {
                int alpha = 255;
                resetFadeEffect(this.fadeEffect, alpha, FadeEffect.FadeState.PartialIn);
                resetFadeEffect(this.selectedFadeEffect, alpha, FadeEffect.FadeState.PartialIn);
                this.state = State.Visisble;


                float effectLife;
                Base2DSpriteDrawable shockWave = ModelGenerationUtil.generateWaveEffect(content, base.Position, Color.Green, out effectLife);
                VisualEffect         effect    = new VisualEffect(shockWave, effectLife);
                EffectsManager.getInstance().Visuals.Add(effect);
            };
            Skill booSkill    = new Boo(booSfx, boo);
            Skill shriekSkill = new Shriek(shriekSfx, shriek);
            Skill appearSkill = new Appear(whooshSfx, appear);
            Skill hideSkill   = new Disappear(whooshSfx, disappear);

            this.aggressiveSkills = new Dictionary <Keys, Skill>();
            this.aggressiveSkills.Add(Keys.D1, booSkill);
            this.aggressiveSkills.Add(Keys.D2, shriekSkill);

            this.passiveskills = new Dictionary <Keys, Skill>();
            this.passiveskills.Add(Keys.D3, appearSkill);
            this.passiveskills.Add(Keys.D4, hideSkill);

            this.Skills = new List <Skill>();
            this.Skills.Add(booSkill);
            this.Skills.Add(shriekSkill);
            this.Skills.Add(appearSkill);
            this.Skills.Add(hideSkill);
        }