Book Image

Construct 2 Game Development by Example

By : John Bura
Book Image

Construct 2 Game Development by Example

By: John Bura

Overview of this book

Table of Contents (16 chapters)
Construct 2 Game Development by Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Where to Go from Here
Index

Tracking the score


Let's set things up so that we can track a score for destroying the goalBall sprites. Add another global variable and name it Score, as shown in the following screenshot:

Then, add another goalBall action. This time, make it an Add to action that adds to the value of Score. Let's insert 100 in the Value field, as shown in the following screenshot:

Then, just copy-and-paste this action to all the other goalBall collision events. Now, every time a goalBall sprite is destroyed, your player's score will increase by 100!