//	void OnTriggerEnter2D(Collider2D collider) {
//		MovingObject movingObject = collider.gameObject.GetComponent<MovingObject>();
//		if (movingObject != null) {
//			int count = movingObject.damage;
//			if (count < 0) {
//				gameControl.AddHealth (count);
//			} else {
//				gameControl.Hurt (count);
//			}
//			if (movingObject.destroy) {
//				Destroy (collider.gameObject);
//			}
//		}
//	}
    void OnTriggerEnter2D(Collider2D collider)
    {
        if (movingObject == null)
        {
            movingObject = collider.gameObject.GetComponent <MovingObject> ();
            if (movingObject != null)
            {
                int count = movingObject.damage;
                if (count < 0)
                {
//					ParticleSystem heal = GetComponent<ParticleSystem>();
//					heal.Play();
                    healParticle.Play();
                    gameControl.AddHealth(count);
                    //Instantiate(coinparticle, collider.transform.position, Quaternion.identity);
                }
                else
                {
                    gameControl.Hurt(count);
                    hurtParticle.Play();
                }
                if (movingObject.destroy)
                {
                    Destroy(collider.gameObject);
                }
            }
        }
    }