FIIIIIREEEEE

This commit is contained in:
2023-06-28 13:38:48 +03:00
parent 79c870b6fa
commit c79d2a6b49
25 changed files with 1415 additions and 1798 deletions
+14
View File
@@ -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"));
}
}