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

public class Player : MonoBehaviour
{
    [SerializeField]private GameObject bulletPrefab;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.W))
        {
            GameObject bullet = Instantiate(bulletPrefab, new Vector2(0,0.5f), Quaternion.identity);
            bullet.GetComponent<Bullet>().direction = Vector2.up;
        }
        
        if (Input.GetKeyDown(KeyCode.D))
        {
            GameObject bullet = Instantiate(bulletPrefab, new Vector2(0.5f,0), Quaternion.identity);
            bullet.GetComponent<Bullet>().direction = Vector2.right;
        }
    }
}
