Skip to content
Snippets Groups Projects
Commit 7b8755c3 authored by Robin Halseth Sandvik's avatar Robin Halseth Sandvik
Browse files

Swapped the player's attack to use the new ability system.

parent 33cca7ad
No related branches found
No related tags found
1 merge request!24PrefabService & abilities
......@@ -32,7 +32,7 @@ namespace BigSock {
protected IAttack _testAttack = new BasicProjectile1();
public DateTime NextTimeCanAttack { get; private set; } = DateTime.Now;
......@@ -52,6 +52,7 @@ namespace BigSock {
TryPickUpItem(ItemService.SINGLETON.Get(201));
TryPickUpItem(ItemService.SINGLETON.Get(201));
TryPickUpItem(ItemService.SINGLETON.Get(202));
var tmp = PrefabService.SINGLETON;
}
......@@ -98,10 +99,12 @@ namespace BigSock {
if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButton(0)) {
// Manage attack cooldown.
if(NextTimeCanAttack <= DateTime.Now) {
NextTimeCanAttack = DateTime.Now.AddSeconds(AttackCooldown);
//NextTimeCanAttack = DateTime.Now.AddSeconds(AttackCooldown);
//var bullet = Instantiate(attack, new Vector3(transform.position.x, transform.position.y, transform.position.z), attack.transform.rotation);
//bullet.GetComponent<AttackMovement>().Actor = this;
var bullet = Instantiate(attack, new Vector3(transform.position.x, transform.position.y, transform.position.z), attack.transform.rotation);
bullet.GetComponent<AttackMovement>().Actor = this;
_testAttack.Use(this, Camera.main.ScreenToWorldPoint(Input.mousePosition));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment