Jump to content

can i have some sort of scoreboard in unity?

Legolessed

im creating a 2d game called hole digger in unity for lols but i cant figure out how to make a button add a number to a text box every time its pressed. also i want the shovel to move down and back up and for every dig i want the camera to move down. Of course this will mean im going to need to add more ground panels. and a way to zoom in the camera and have it kind of follow the shovel. Is there any way to do this? thanks for the help

Link to comment
Share on other sites

Link to post
Share on other sites

Of course, this is possible.  For the text box you should use a UI Element and change its content in some sort of "GameManager". By following this pattern you could implement achievements as well. To make the shovel move you'd have to create sprites and animate the states of the shovel. The states can be used to trigger the animations by code. To add more game panels you should consider "recycling" the prefabs by implementing an object pooling system. This would mean you'd instantiate 20 prefabs for your ground and put them below the bottom screen edge as soon as they are destroyed. That can save you a lot of memory!

Since it doesn't seem like you have a lot of experience in programming neither in Unity I think it would be more helpful for you to take some beginner classes in Unity and C#! 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×