using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BouncingEnemy : MonoBehaviour {

	private Rigidbody2D rg;
	[SerializeField] private float speed = -1;

	void Start () {
		rg = GetComponent<Rigidbody2D> ();
	}
	
	void Update () {
//		rg.velocity = new Vector2 (speed,10 * Mathf.Abs(Mathf.Sin(transform.position.x)));
		transform.position = ( new Vector2 (transform.position.x+speed,2 * Mathf.Abs(Mathf.Sin(transform.position.x))));
	}
}
