Score & Coins & Lives
-
- Posts: 9
- Joined: Sun Jul 07, 2019 1:05 am
Score & Coins & Lives
Hello!
Is it possible to Add & Take By Button Click?
I would like to Perform All The Actions after clicking a UI Button.
Give & Take Score
Give & Take Coins
Give & Take Health
Give & Take Lives
Is this already possible?
I'm making a clicker game and It would be important to add and take these values away.
I tried using a conditional action already.
Is it possible to Add & Take By Button Click?
I would like to Perform All The Actions after clicking a UI Button.
Give & Take Score
Give & Take Coins
Give & Take Health
Give & Take Lives
Is this already possible?
I'm making a clicker game and It would be important to add and take these values away.
I tried using a conditional action already.
Re: Score & Coins & Lives
Hi ez2ciamaprincess
There is nothing that does this currently, although it is only a small component that would be needed:
using GameFramework.GameStructure;
using UnityEngine;
public class AddTakeScore : MonoBehaviour {
public int Points;
// Hook this up to the Button event
public void ButtonOnClickCallback() {
GameManager.Instance.Player.AddPoints(Points);
}
}
How would this work though so that the user can't click it multiple times?
There is nothing that does this currently, although it is only a small component that would be needed:
using GameFramework.GameStructure;
using UnityEngine;
public class AddTakeScore : MonoBehaviour {
public int Points;
// Hook this up to the Button event
public void ButtonOnClickCallback() {
GameManager.Instance.Player.AddPoints(Points);
}
}
How would this work though so that the user can't click it multiple times?
-
- Posts: 9
- Joined: Sun Jul 07, 2019 1:05 am
Re: Score & Coins & Lives
Thank You!
I used your script to make the coins work too, Does the lives work the same way? It gives me errors.
I either need a way to subtract lives with button click, Which triggers the games over after lives reach 0 ... Or a button click function that triggers game over and game won.
"How would this work though so that the user can't click it multiple times?"
After the button is clicked it gets destroyed.
I used your script to make the coins work too, Does the lives work the same way? It gives me errors.
I either need a way to subtract lives with button click, Which triggers the games over after lives reach 0 ... Or a button click function that triggers game over and game won.
"How would this work though so that the user can't click it multiple times?"
After the button is clicked it gets destroyed.
-
- Posts: 9
- Joined: Sun Jul 07, 2019 1:05 am
Re: Score & Coins & Lives
Nevermind I figured it out. Would we use these same values to report score to Google Play Leader boards?
Re: Score & Coins & Lives
Yes - it would be the same values.
-
- Posts: 9
- Joined: Sun Jul 07, 2019 1:05 am
Re: Score & Coins & Lives
Hi,
Do you have plans to integrate leaderboards and achievements from Google play games?
Im having trouble saving my score to the leaderboard. I followed this tutorial here:
Video:
https://www.youtube.com/watch?v=5Ae8GeRmdH0
Code:
https://resocoder.com/2017/02/24/gpg-tu ... ards-code/
Everything Works fine except the score will only report if I use the add score function from the tutorial.
Is there any way to make the game framework
recognize this way of reporting the score?
Do you have plans to integrate leaderboards and achievements from Google play games?
Im having trouble saving my score to the leaderboard. I followed this tutorial here:
Video:
https://www.youtube.com/watch?v=5Ae8GeRmdH0
Code:
https://resocoder.com/2017/02/24/gpg-tu ... ards-code/
Everything Works fine except the score will only report if I use the add score function from the tutorial.
Is there any way to make the game framework
recognize this way of reporting the score?
Re: Score & Coins & Lives
Hi,
This is on my backlog, but unfortunately not a priority at the moment as there are some other bits that I am working on first.
It shouldn't be too difficult to add in support for individual games, but you will need to do a bit of coding. Somewhere like the GameOver class or other periodic saving might be an option.
Mark
This is on my backlog, but unfortunately not a priority at the moment as there are some other bits that I am working on first.
It shouldn't be too difficult to add in support for individual games, but you will need to do a bit of coding. Somewhere like the GameOver class or other periodic saving might be an option.
Mark