How to create a point/score system based on player performance.

Ok this here is a bit of a tricky one. For me at least. I am completely new to scripting and have posted a bunch of questions about my diving game.

I need some hints on how to create a point system based on how well the player performs in the air before hitting the water. I am only an intern and have been given to task to create the prototype of a game we are developing. I therefore have only added a couple of multiple doublejumps while the player is in the air to simulate airborne tricks.

How do I add a counter of some sort that shows how well the player performs. Should I create maybe a GUI that counts every time i press the space button? I have a feeling that is a smart way to do it, but not quite sure how a integrate that with the game in terms of scripting.

Hope to get helpful answers, and will probably post followup questions eventually. :P

In advance... Thanx

You should take a look at other stunt games that already do what you want and copy the system they have.

Have key combos fire different stunt moves, adding bonus score for difficulty and duration for that stunt.

Add stunt combos, stringing together more stunts adds score multipliers, doing a string of different stunts should add more multiplier than doing the same stunt twice.

Don't add any of the bonus points to the player's score if they don't successfully land after a jump.

You can use GUI text or 3D text to flash up the names of stunts and the current bonus score and multiplier.

For this you would need several variables e.g.

var score : int;
var bonus : float;
var bonusMultiplier : float;
var comboString : String;
var successfulLanding : boolean;

Then you need a couple functions to string it all together e.g.

function StuntLand(){
   if(successfulLanding){
      score += bonus*bonusMultiplier
      successfulLanding = false;
   }
   bonus = 0;
   bonusMultiplier = 0;
   comboString = "";
}

comboString would be where you store the list of stunts you've made so it might appear like this on the screen: "360, double ollie, back flip" followed by the bonus and multiplier.

You can append the string with more stunts as the player does them. e.g.

comboString = comboString + ", " + stuntName;

There's several ways how you can capture key combos, if-else statements or switch cases or it might be counting how many times a person rotates in the air or whatever. You can figure that stuff out when you've made up a list of possible stunts.

Ok...

I have fooled around with the GUI stuff and created this small script that I attachet do the GUItexture.:

var trick1 : Texture2D;
var trick2 : Texture2D;
var trick3 : Texture2D;
var trick4 : Texture2D;
var trick5 : Texture2D;
var trick6 : Texture2D;

static var SPLASH = 6;

function Update () 
{
    switch(SPLASH)
    {
        case 0:
            guiTexture.texture = trick1;
        break;

        case 1:
            guiTexture.texture = trick2;
        break;

        case 2:
            guiTexture.texture = trick3;
        break;

        case 3:
            guiTexture.texture = trick4;
        break;

        case 4:
            guiTexture.texture = trick5;
        break;

        case 5:
            guiTexture.texture = trick6;
        break;
    }
}

How do I make the GUItexture change every time I performe a trick (press the jump buttoon)?

This is my character controller script but only the jumping part with double jump part.

//Jumping

var jumpSpeed = 15.0; 
var gravity = 20.0;
var speedSmoothing = 5.0;
var maxFallSpeed = 50.0;

private var moveDirection = Vector3.zero; 
private var grounded : boolean = false; 
private var jumpCount:int; 
private var onGround:boolean; 

function FixedUpdate() { 
   if (grounded) { 

      // We are grounded, so recalculate movedirection directly from axes 
      moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, 0); 
      moveDirection = transform.TransformDirection(moveDirection); 
      moveDirection *= speed; 
     jumpCount = 0; 
   } 
   if (Input.GetButtonDown ("Jump") && jumpCount < 20) 
  { 
    moveDirection.y = jumpSpeed; 
    jumpCount++;

} 

PS. I followed the TornadoTwinns tutorial on youtube.