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

Added second attack to player for testing.

- Activate using the z key.
parent 7f3ef45f
No related branches found
No related tags found
1 merge request!26Added second attack to player for testing.
...@@ -32,7 +32,8 @@ namespace BigSock { ...@@ -32,7 +32,8 @@ namespace BigSock {
protected IAttack _testAttack;// = new BasicProjectile1(); protected IAttack _testAttack;
protected IAttack _testAttack2;
public DateTime NextTimeCanAttack { get; private set; } = DateTime.Now; public DateTime NextTimeCanAttack { get; private set; } = DateTime.Now;
...@@ -54,6 +55,7 @@ namespace BigSock { ...@@ -54,6 +55,7 @@ namespace BigSock {
TryPickUpItem(ItemService.SINGLETON.Get(202)); TryPickUpItem(ItemService.SINGLETON.Get(202));
var tmp = PrefabService.SINGLETON; var tmp = PrefabService.SINGLETON;
_testAttack = (IAttack) AbilityService.SINGLETON.Get(101); _testAttack = (IAttack) AbilityService.SINGLETON.Get(101);
_testAttack2 = (IAttack) AbilityService.SINGLETON.Get(102);
} }
...@@ -95,8 +97,7 @@ namespace BigSock { ...@@ -95,8 +97,7 @@ namespace BigSock {
} }
private void Update() private void Update() {
{
if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButton(0)) { if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButton(0)) {
// Manage attack cooldown. // Manage attack cooldown.
if(NextTimeCanAttack <= DateTime.Now) { if(NextTimeCanAttack <= DateTime.Now) {
...@@ -110,6 +111,10 @@ namespace BigSock { ...@@ -110,6 +111,10 @@ namespace BigSock {
} }
} }
if(Input.GetKey(KeyCode.Z)) {
_testAttack2.Use(this, Camera.main.ScreenToWorldPoint(Input.mousePosition));
}
//!! Code for testing the new item stuff. //!! Code for testing the new item stuff.
if(Input.GetKeyDown(KeyCode.Space)) { if(Input.GetKeyDown(KeyCode.Space)) {
var item = ItemService.SINGLETON.GetRandom(); // new ItemRunningShoes(); var item = ItemService.SINGLETON.GetRandom(); // new ItemRunningShoes();
......
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