Adding an attack

I feel like for this section to truly be called tilevania; Then we should add an attack! Otherwise its more like Super Tileo Bros. I have been trying a few things, but have been running into problems. I tried using some of what we learned in Laser defender, but it just isn’t working out. The enemy has two colliders that are both triggers, and when I tried introducing my projectile trigger I started getting errors. Specifically when the enemy was checking for his ledge triggers. I didn’t notice any negative impact from the bug, but my fireball won’t deal any damage. It is also only shooting right, but I haven’t looked into that!

Edit: Fixed it

1 Like

Figured I would update this with my progress.
I have gotten the enemy to die, and even added a deathKick just for laughs. Now I just need to look into making it so I can shoot left. Right now I only shoot right no matter my direction.

1 Like

Well I decided to post one last update so this post can be closed.
This line of code flips the shoot direction.

fireball.GetComponent().velocity = new Vector2(transform.localScale.x * projectileSpeed, 0);

1 Like

Privacy & Terms