Points Distribution Script
1. What it Does
With some games you want the player to be able to choose between a number of different options. Each of these options has a 'cost' in points so that they can slect more than one option provided that the number of points required for the selected options does not exceed the points available. This script will display the number of points that remain available as the various options are selected and stop options being selected if the required points exceeds the number remining.
To start with let's look at an example of how the script works. In this example there are fifty points available and four options. As you select the options the number of points remaining will be reduced accordingly. If you attempt to select an option that exceeds the number remaining an 'insufficient points' alert will be displayed and the option will be unchecked.
Next we will look at the coding of the script and how to add the script to your page.