Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wannasaynone/5470b7b4278704ed81e1e831c0b4c757 to your computer and use it in GitHub Desktop.
Save wannasaynone/5470b7b4278704ed81e1e831c0b4c757 to your computer and use it in GitHub Desktop.
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