Entry 4 - Score counting


1.5.2021 [4h]

I have painted gem assets for score counting and downloaded free chest asset to the end of lavel.

I have added switch to open the final doors, the switch is standard prefab in 2Dgamekit. I have created blue, red and purple gems which on trigger calls static function "AddScore(int score)" at ScoreCounter and on update is score updated in UI.

Also i chnaged code in "PlayerCharacter" a function "OnDie()" to reset spownpoint to start of level, score to 0 and reset scene.


Problems/findings:

  • Thare is a difference which function is called when GameObject has 2DCollider and Collider. When 2D Colleder is present then "OnTriggerEnter2D(Collider2D collider)" is called and "OnCollisionEnter(Collider collider)" when standard Collider is present.
  • Thare is a problem when recovering layer id by name using "LayerMask.GetLayer(string name)" is returning unsensible id. I have checked for layerID recovery the Unity documentation and couple of tutorials but i did't find a solution.

Potencial future updates:

  • Controls using arrows - It would seam that is requires big changes to the existing code.
  • Tune a bit more player controls - for more optimal user experiance.

Files

Project_B_v.0.4.zip 89 MB
May 02, 2021

Get Project B

Leave a comment

Log in with itch.io to leave a comment.