Can you give provide feedback/insight on the gameplay of my game Portal Reign?

all done

Ok, here comes a bit list of changes to make, work through them slowly and carefully…


  • Open GameController.cs
  • Remove the following two lines of code;
    public Text youWinText;
    public Text youLoseText;
    
  • Add the following line of code;
    [SerializeField]
    private Text outcome;
    
  • Remove the following two lines of code;
    private bool youWin = false;
    private bool youLose = false;
    
  • Within the Start method, remove these two lines of code;
    youWinText.text = "";
    youLoseText.text = "";
    
  • Add the following line of code;
    outcome.text = "";
    
  • Within the OnGUI method (questionable usage, this should be replaced later)
    • Change this line of code;
      youWinText.text = "You Win!";
      
      to;
      outcome.text = "You Win!";
      
    • Remove this line of code;
      youWin = true;
      
    • Change this line of code;
      youLoseText.text = "You Lose!";
      
      to;
      outcome.text = "You Lose!";
      
    • Remove this line of code;
      youLose = true;
      
  • Save the script
  • Within Unity, select the GameController within the Hierarchy
  • Drag the Outcome UI Text GameObject to the Outcome field, exposed in the Inspector
  • Run the game, you won’t see much difference but there should be no errors in the console

okay will work on this :wink:

I’ll hang around for another 15 minutes.

Nice!! it works!! but after I kill 12 enemies the You Lose! message appears then I kill the last enemy and the You Win! appears it this accurate?

You’re rushing ahead.

Very Awesome

I Thank you sorry for rushing :slight_smile:

So, looking at the conditions we want to serve;

Let’s tackle the top one first.

Looking at the ways which you are detecting collision you have a CollisionHandler.cs script and you also have a DestroyByContact.cs script. Both make calls to the GameOver method within GameController.cs.

When I use Find all references for the DestroyByContact.cs script within Unity I don’t find anything that is using it.

Can you confirm this is the case and state any reason why we shouldn’t delete it.

I will delete it.

Ok, so DestroyByContact.cs is now gone.

If you know look at the GameOver method within GameController.cs, within Visual Studio, right-click on it and select “Find All References” you should only see the one reference which is for the CollisionHandler.cs script.

Correct?

This is what I see

  • Scroll down to the method name GameOver.
  • Right-click on it (on it’s name)
  • Select “Find All References”

Okay

You should only see the one reference which is for the CollisionHandler.cs script.

Got it

Good.

So we know that currently the only code that is calling the GameOver method is the CollisionHandler.cs script.

Now, back into Unity, select the CollisionHandler.cs script, right-click and select “Find References In Scene”.

You should see a filter Hierarchy on the left with two entries, the Game Controller and the Player Ship.

image

Correct?

Let me check.

Got it.![Screenshot%20(28)|690x388]

Screenshot%20(29)

Privacy & Terms