The score label properties:
Label
- (name): lblScore
- BackgroundColor: Web > Transparent
- Location: 555;65
- Font: Microsoft Sans Serif; 9,75pt; style=Bold
- Text: 0
Then, add this code to your project:
(put it in the DoTheScoreMath() method.)
// We'll process the score only
// if there's multiple blocks
// in the 'Connected List'.
if (ConnectedList.Count > 1)
{
// I've declared some
// variables to hold
// some values I intend
// on using to calculate
// the score.
int a = ConnectedList.Count;
int b = iLevel;
int c = iColor;
int d = ConnectedList[0].iFieldColor;
// Scoring formula...
// You can play with it
// as you like :)
int e = a * (b + c) * d;
// Just don't forget to
// add it to the total
// score:
iScore += e;
}
// Oh, and to be a little
// naughty, we'll substract
// a point for every click
// the user makes...
// BUAHAAHAAHHAAAAA!
iScore--;
// Display the total score:
lblScore.Text = iScore.ToString();
Now, add the call in the 'picGF_MouseClick' method, after the existing code:
DoTheScoreMath()
Done? Cool! Ok, what now? Levels would be cool... Right, then! Next chapter: Levels!
0 comments:
Post a Comment