using UnityEngine;
using System.Collections;

public class FloatingCrown : MonoBehaviour {

    Vector2 floatY;
    float originalY;

    public float floatStrength = 1.0f;

    public float offsetY;

    void Start()
    {
        Color myColor = GetComponent<SpriteRenderer>().color;
        GetComponent<SpriteRenderer>().color = new Color(myColor.r, myColor.g, myColor.b, 1.0f);
        this.originalY = this.transform.position.y;
    }

    void Update()
    {
        floatY = transform.position;
        floatY.y = (Mathf.Sin(Time.time) * floatStrength) + offsetY;
        transform.position = floatY;
    }
}
