About 'Add Player Score'!

In this video (objectives)…

  1. Create currentScore and pointsPerBlockDestroyed variables.
  2. Create a public method that adds to our score when called.
  3. Call the method which increases our score when a block is destroyed.

After watching (learning outcomes)… Able to increase the player's score when a block is destroyed.

(Unique Video Reference: 24_BR_CUD)

We would love to know…

  • What you found good about this lecture?
  • What we could do better?

Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…

  • Be in the correct forum (for the course).
  • Be in the right sub-forum (for the section)
  • Have the correct lecture tag.

Enjoy your stay in our thriving community!

Hello @Rick_Davidson, I just want to take a moment and thank you for all the great content in this course so far. I love the challenges (even if I fail them, I at least attempted and usually get some of it right) as they allow me to access my growth. You are doing such a better job teaching me programming than any college programming course I have taken. So thank you for all the help so far. Can’t wait to see what else this course brings!!

1 Like

Just learnt that one can call a variable from another script like we do classes, as long as it is a public variable. It works and I can define what each block is worth, the only issue that is arising is that the script seems to be using the prefabs worth only. So even though i have 5 blocks all with different points it only uses the prefabs.

EDIT: Scratch that it seems to use the value of the last block added to the scene for all the blocks, strange…

problem solved using a different approach.

Displaying my score with a coroutine so that the numbers go up X numbers at a time like if you were playing pinball.

Example: Block is worth 5 points the score will go 1,2,3,4,5 and then stop.

I think it looks pretty cool.

Privacy & Terms