score

Global variable for holding the game score.

Syntax:

score;


Returns: Real


Description

This variable is global in scope and is used to hold a numeric value which is usually used for the game score. Bear in mind this is not necessarily always the case - just because it's called "score" doesn't mean it has to be used for the score and it can be used to hold any integer value you choose.


Example:

if place_meeting(x, y, obj_Bullet)
   {
   score += 10;
   instance_destroy();
   }

The above code checks the current instance to see if there is a collision with the instance of the object indexed in "obj_Bullet", and if there is, it adds 10 to the global score and then destroys itself.


Back: Global Variables
Next: health
© Copyright YoYo Games Ltd. 2018 All Rights Reserved