- The most challenging step for me was getting the player to collide with the new pickups and then making those disappear and then add score. At first they both had separate codes, so I had two lines for "void OnTriggerEnter2D(Collider2D other)", one for each pickup. I was able to fix this problem after a lot of trial and error by removing the second one and adding it to my first with an "else if" line of code to go after the "if" code. I learned that you don't always need to give something it's own set of code, and can use "else if" on similar things.
No comments:
Post a Comment