Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Gamesalad Essentials

You're reading from   Gamesalad Essentials Create awesome cross-platform games in no time, and with no coding

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher
ISBN-13 9781784391973
Length 154 pages
Edition 1st Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Miguel DeQuadros Miguel DeQuadros
Author Profile Icon Miguel DeQuadros
Miguel DeQuadros
Arrow right icon
View More author details
Toc

Scoring and Saving Games


Remember in an earlier chapter we talked about saving the game? I bet you thought I forgot about that, didn't you? I certainly didn't! We will get to that in a moment, but first we are going to set up the scoring system.

In the scene editor, create a new game-wide attribute; it's going to be an Integer. Name it Score. Now create a new actor, name it Score, or something that you'll remember. Open it up so we can edit it. Change the Size to something small, like 32 x 32. Drag in a Change Attribute behavior, and change it to Change Attribute: self.Color.Alpha to: 0. This will hide the actor only when you hit play, so when you are placing it within the scene, you will see it.

Now drag in a Display Text behavior, click on the e button to open the expression editor, and change it to game.Score, so it displays the score value:

Finally, don't forget to uncheck the Movable option under the Physics drop down to prevent it from falling off the screen, and move it into a non-scrollable...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image