Certain Requirements rather than Scoring System to go on to the next level of the game.

Hi guys. This is my first time doing this because we are making a thesis for a certain game to android phone. And I was wondering if, instead of a Scoring System using integers, we change it into a certain requirements. I can’t put on into words so, here’s the picture:

I hope you can help me since I don’t have any much idea about Mobile Development. :slight_smile: Thanks :slight_smile:

Your going to have to create a Class that keeps track all the objects that a player gets. You would then add a Method in that class that could return true/false if I sent it a number and object type.

Your ScoreSystem / Level Manager would then just run down its list of requirements and Ask the class if the player has 2 food or 1 Water, etc. If it gets all trues then go to the next level. If it gets a false, pop up the failure,restart level screen

Do you have any clue or codes… I don’t think I could follow that… :confused:

This would greatly depend on how you implement the game. I assume someone is going to be coding how to randomly put items out on this screen, and code moving the guy around to grab items. Keeping track of items grabbed?

Here’s the code by the way for the score manager… I took it from the jewel mining tutorial game video tutorial:

using System.Collections;
using UnityEngine.UI;

public class ScoreManager : MonoBehaviour {

public int score=0;
public int targetScore=400;
public Text scoreText;
public Text timeText;
public int timePerLevel=45;
public GameObject youWon;
public GameObject gameOver;

public float clockSpeed=1f;



void Awake ()
{
scoreText.text = ("Score: " + score + "/" + targetScore);
InvokeRepeating ("Clock", 0, clockSpeed);
}

void Clock()
{
timePerLevel--;
timeText.text = ("Time: " + timePerLevel);
if (timePerLevel == 0)
{
CheckGameOver();
}
}

public void AddPoints(int pointScored)
{
score += pointScored;
scoreText.text = ("Score: " + score + "/" + targetScore);
}

void CheckGameOver()
{
if (score >= targetScore) {
Time.timeScale = 0;
youWon.SetActive (true);
} else
{
Time.timeScale=0;
gameOver.SetActive(true);
}
}
}

WHat should I change here for the score manager? :confused:

This would be the code you’d have to change for your game:

void CheckGameOver()
{
   // specifically this if statment
   if (score >= targetScore) {
   Time.timeScale = 0;
   youWon.SetActive (true);
   } else
   {
   Time.timeScale=0;
   gameOver.SetActive(true);
   }
}

But what you change it to is what is dependent on the REST of the code of your game. Without knowing more about that and how your coding (or how you will code it) you can’t do this part. I only made assumptions before about how the game works. That there is a guy moving around with a hook grabbing things. Who is going to be in charge of coding the game?

How will you generate objects on the screen when a level starts?
How will you move the guy around and work his hook?
What happens if he catches item, how do you plan on removing it from the screen and keep track they got that particular item?

Once those items are finished and coded, making the scoring and Level end will be a much easier thing to do. If that stuff is already coded, some answers as to how objects are handled would need to be answered to help you change the CheckGameOver function