public void SpawnNoteBlock(GuildWarsControls key, InstrumentSkillType noteType, Color spriteColor) { NoteBlock note = new NoteBlock(key, noteType, spriteColor) { Parent = this }; }
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; }
public void SpawnNoteBlock(IKeyboard keyboard, GuildWarsControls key, InstrumentSkillType noteType) { var note = new NoteBlock(keyboard, key, noteType) { Parent = this }; }
/// <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; }