How to make high score based on collected coins? [closed] - 2d

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I’m creating small 2d platformer on Unity. The core is that you have 30 sec to spend on a level + plus an enemy chasing you. You have to act fast and aggressive to get those coins. So, actually how to make the score go up after I touch a coin? And how to make it disappear after that? I thought I could make a trigger, but I want the coin to be driven by physics, because it looks cool when it falls from midair on the ground.

insert this sample on your coins and add Coillder + trigger it
private void OnTriggerEnter(Collider other)
{
if(other.gameObject.tag == "yourplayertag"){
PlayerPrefs.SetInt("yourCoin", PlayerPrefs.GetInt("yourCoin") + 1); // if your coins stored in playerprefs
Destroy(gameObject);
}
}
and advice, you need to learn more about unity and this is not here on Stack, your question is very basic, do some research first and try many times, tutorials and unity manual will help

Related

Is there any way I can log the changes that have been made on CRM elements in Bitrix24? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 days ago.
Improve this question
I would like to log some changes that may happen on CRM cards in my Bitrix24 account, is there any way I can compare the old fields to the new ones?
So, in this case, I would know every change that have been made and who did it
I tried to create a business process, so every time I update a deal, lets say, I would log the changes, but I couldn't find a function that does it.

How to change the turn of a player in an online multiplayer game in Unity [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm new in Unity and I'm trying to create an online multiplayer game. This game is a tanks fight. The tank is prefab and it's called to be created twice. When you press the Space keyCode the tank shoots a bullet. I have all the network connections done but now I want to control the players turn. For example, if localPlayer shoots one time this would have to be the turn of the second player and so on.
Can anyone help me please?
How about having a common variable which updates after each turn. depending on the value of the variable you can determine who has the turn. you have to define the order which they take turns before starting the game.
Assume you have n players, and a common int value x which increases by 1 after each turn.
if( x%n == turn && Input.GetKeyDown(KeyCode.Space))
shoot();
players will not be able to shoot unless it's their turn. use a simple RPC function to update x from clients after each turn.

How to implement a gamification system in ASP.NET Web Application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm building a Web Application using ASP.NET MVC and I'd like to implement a Gamification system to make the user experience more exciting.
I'd like to start with a simple score for each user and as they progress and get more points they get badges and unlock new features for themselves, something similar to how Stackoverflow does it.
What appears challenging to me is how to check in the entire application, whether a user has reached a score that can recieve a badge. I don't want to duplicate my code and perform this check in every place that I'm incrementing a user's score.
I'd like to know how can I start implementing such a system. I know it's a broad question but I'm just looking for some starting ground and some good practice to begin.

Is it possible to reprogram a robot? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I bought a RC Helicopter and I'm just wondering that it's possible to be reprogrammed or not?
If can how to do that? I know this question sounds ridiculous. :)
Thanks for replying
What do you mean reprogrammed?
If you want to make the remote control a light instead of a motor, the answer is yes. If you mean add any intelligence to the toy, the answer is no.
If you are interested in programming, building robots etc, look into microcontrollers. The Arduino is a great one for young enthusiasts.
Some parts of the RC helicopter you can reprogrammed like the ESC, and the main circuit board always can't reprogrammed. Of course, there was exception, for some beta version, most of the board you can reprogrammed in limitted range

what does the term rep-invariant and rep ok means? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I heard this a lot when talking about software engineering and abstract data types, what does this do? Can anyone give me a concrete example of this concept?
A representation invariant is a condition concerning the state of an object. The condition can always be assumed to be true for a given object, and operations are required not to violate it.
In a Deck class, a representation invariant might be that there are always 52 Cards in the deck. A shuffle() operation is thus guaranteed not to drop any cards on the floor. Which in turn means that someone calling shuffle(), or indeed any other operation, does not need to check the number of cards before and after: they are guaranteed that it will always be 52.

Resources