public override bool NewRightClick(int i, int j) { int soundCode = GetSoundCode(i, j); PitchHelper.PlaySound(mod, soundCode, i * 16 + 8, j * 16); int dust = Dust.NewDust(new Vector2(i * 16 - 6, j * 16 - 2), 0, 0, DustType <Dusts.MusicalNote>()); Main.dust[dust].velocity.X = 0f; Main.dust[dust].velocity.Y = -1f; return(base.NewRightClick(i, j)); }
public void PlayPianoSound(int keyIndex) { if (keyIndex < keyRange) { int soundCode; if (keyIndex < 7) { soundCode = PitchHelper.EncodeSoundCode(1, 3, KeyIndex2Pitch[keyIndex] + 12); } else if (keyIndex < 14) { soundCode = PitchHelper.EncodeSoundCode(1, 4, KeyIndex2Pitch[keyIndex]); } else { soundCode = PitchHelper.EncodeSoundCode(1, 5, KeyIndex2Pitch[keyIndex] - 12); } PitchHelper.PlaySound(ModLoader.GetMod("Pianist"), soundCode); Main.NewText("PlayPianoSound " + keyIndex); } }