Esempio n. 1
0
        public NoteBlock(IKeyboard _keyboard, GuildWarsControls _key, InstrumentSkillType _noteType)
        {
            this.ZIndex = 0;
            switch (_key)
            {
            case GuildWarsControls.WeaponSkill1:
                this.Lane = 13;
                break;

            case GuildWarsControls.WeaponSkill2:
                this.Lane = 75;
                break;

            case GuildWarsControls.WeaponSkill3:
                this.Lane = 136;
                break;

            case GuildWarsControls.WeaponSkill4:
                this.Lane = 197;
                break;

            case GuildWarsControls.WeaponSkill5:
                this.Lane = 260;
                break;

            case GuildWarsControls.HealingSkill:
                this.Lane = 429;
                break;

            case GuildWarsControls.UtilitySkill1:
                this.Lane = 491;
                break;

            case GuildWarsControls.UtilitySkill2:
                this.Lane = 552;
                break;

            case GuildWarsControls.UtilitySkill3:
                this.Lane = 614;
                break;

            case GuildWarsControls.EliteSkill:
                this.Lane = 675;
                break;
            }
            this.fKeyboard   = _keyboard;
            this.fKey        = _key;
            this.NoteSprite  = NoteTexture[_noteType];
            this.SpriteColor = NoteColor[_noteType];
            this.Size        = new Point(56, 20); // set static bounds.
            this.Location    = new Point(Lane, 0 - this.Width);
            NoteAnim         = Animation.Tweener
                               .Tween(this, new { Top = Graphics.SpriteScreen.Height - 100 }, 10)
                               .OnComplete(() => {
                NoteAnim = null;
                this.Dispose();
            }
                                           );
            Graphics.SpriteScreen.Resized += UpdateLocation;
        }
Esempio n. 2
0
        private Tween(object target, float duration, float delay, Tween.TweenerImpl parent)
        {
            Target = target;
            Duration = duration;
            Delay = delay;
            Parent = parent;
            Remover = parent;

            firstUpdate = true;

            varHash = new Dictionary<string, int>();
            vars = new List<GlideInfo>();
            lerpers = new List<Lerper>();
            start = new List<object>();
            end = new List<object>();
            behavior = Lerper.Behavior.None;
        }
        /// <summary>
        /// Creates a note block.
        /// </summary>
        /// <param name="_keyboard">The keyboard this note block reacts to.</param>
        /// <param name="_key">The key this noteblock reacts to.</param>
        /// <param name="_noteType">The type of the note skill used ingame.</param>
        public NoteBlock(GuildWarsControls _key, InstrumentSkillType _noteType, Color _spriteColor)
        {
            this.ZIndex      = 1;
            this.Size        = new Point(56, 20);
            this.NoteSprite  = NoteTextures[_noteType];
            this.SpriteColor = _spriteColor;
            this.NoteKey     = _key;
            this.XOffset     = ConveyorLanes[_key];
            this.Location    = new Point(XOffset, 0 - this.Width);

            NoteAnim = Animation.Tweener
                       .Tween(this, new { Top = Graphics.SpriteScreen.Height - 100 }, 10)
                       .OnComplete(() => {
                NoteAnim = null;
                this.Dispose();
            }
                                   );
            Graphics.SpriteScreen.Resized += UpdateLocation;
        }
Esempio n. 4
0
        public void FadeOut()
        {
            if (Fade != null)
            {
                return;
            }

            float duration = 2.0f;

            if (this.CurrentLoadScreenTip != null)
            {
                if (this.CurrentLoadScreenTip is GuessCharacter)
                {
                    GuessCharacter selected = (GuessCharacter)this.CurrentLoadScreenTip;
                    selected.Result = true;
                    duration        = duration + 3.0f;
                }
                else if (this.CurrentLoadScreenTip is Narration)
                {
                    Narration selected = (Narration)this.CurrentLoadScreenTip;
                    duration = duration + selected.ReadingTime;
                }
                else if (this.CurrentLoadScreenTip is GamingTip)
                {
                    GamingTip selected = (GamingTip)this.CurrentLoadScreenTip;
                    duration = duration + selected.ReadingTime;
                }
            }
            Fade = Animation.Tweener.Tween(this, new { Opacity = 0.0f }, duration);
            Fade.OnComplete(() => {
                this.Visible = false;
                this.NextHint();
                Fade.Cancel();
                Fade = null;
            });
        }
Esempio n. 5
0
 void IRemoveTweens.Remove(Tween tween)
 {
     toRemove.Add(tween);
 }