public void SpriteCollision(ref Character name, SoundEffectInstance song6Inst, SoundEffectInstance song7Inst)
{
//Temporary Value for Object position
Vector2 currentPos;
//Difference between each objects edges
Vector2 Diff = new Vector2(0, 0);
//Obtain difference from Actionhandler
Diff = CollisionCheck(name.SpriteID);
//For X axis difference
if (Math.Abs(Diff.X) > 0)
{
//Sounds for colliding into object
song6Inst.Volume = 1.0f;
song6Inst.Play();
currentPos = name.pos;
currentPos.X -= Diff.X;
name.pos = currentPos;
}
//For Y axis difference
if (Math.Abs(Diff.Y) > 0)
{
//Sounds for colliding into object
song7Inst.Volume = 1.0f;
song7Inst.Play();
currentPos = name.pos;
currentPos.Y -= Diff.Y;
name.pos = currentPos;
}
}