Unity Tutorial 03
For the collectibles part I first gave Ruby a health stat and created new variables, I set Ruby's max health at 5. I then added a new sprite to act as a health collectible and gave it a box collider set as a trigger. Then I created a script for the health collectible to give health to Ruby and also adjusted Ruby's script so that it can check if Ruby needs health. If Ruby's health is at max it wont collect the health collectible.
I then went ahead and added a damage zone and also took care of some of the graphics by tiling the sprites instead of stretching them so they look better. I also added enemies with rigid bodies and box colliders. I also created a new script for them called EnemyController. I then used OnCollisionEnter2D to be able to have Ruby take damage when colliding with enemies.
I found these tutorials to be quite straight forward and I really enjoyed learning more about creating 2D games. I'm definitely looking forwards to completing this game.
Comments
Post a Comment