FIIIIIREEEEE
This commit is contained in:
@@ -2,10 +2,19 @@ using UnityEngine;
|
||||
|
||||
public class Player : Character
|
||||
{
|
||||
[SerializeField]
|
||||
private Transform _hammerSpawnPoint;
|
||||
[SerializeField]
|
||||
private GameObject _hammerPrefab;
|
||||
|
||||
private int _hammerSpeed=10;
|
||||
|
||||
private int _totalCoins = 0;
|
||||
private bool _hasKey = false;
|
||||
public static Player Instance { get; private set; }
|
||||
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
||||
@@ -45,6 +54,11 @@ public class Player : Character
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
var hammer = Instantiate(_hammerPrefab, _hammerSpawnPoint.position, _hammerSpawnPoint.rotation);
|
||||
hammer.GetComponent<Rigidbody2D>().velocity = new Vector2(gameObject.transform.localScale.x * _hammerSpeed,0);
|
||||
}
|
||||
base.MoveTo(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user