Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
if (Input.GetKeyDown(KeyCode.Space) && attackTimer <= 0)
{
switch (attackState)
{
case 1:
Instantiate(AttackWave1, gameObject.transform.position, gameObject.transform.rotation);
attackToAttackTimer = attackToAttackTimeEach;
attackState++;
break;
case 2:
Instantiate(AttackWave2, gameObject.transform.position, gameObject.transform.rotation);
attackToAttackTimer = attackToAttackTimeEach;
attackState++;
break;
case 3:
Instantiate(AttackWave3, gameObject.transform.position, gameObject.transform.rotation);
attackState = 1;
attackToAttackTimer = attackEachTime;
attackTimer = attackEachTime;
break;
}
}
if (Input.GetKey(KeyCode.LeftArrow) && Input.GetKey(KeyCode.UpArrow))
{
gameObject.transform.position = new Vector3(player.x - Speed, player.y + Speed);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.