|Name of gadget||Score|
|Number of Tweak pages||1|
|Last updated||6 June 2019 [v1.02 EA]|
This gadget is used in combination with the Score Modifier gadget. The value saved in this gadget can be used to populate the scoreboard which can only be activated if you place your level within a Dream. The score can be a number or a time. Its value might also be shown on screen using a Number Displayer for example.
You can have multiple score gadgets in a level – be sure to give them unique names so they can be distinguished by the Score Modifier! In this way, you might use one for an actual score and another for in-game currency or an ammunition count.
Example Tutorial (adapted from Media Molecule)
- Stamp a microchip
- Add a score gadget to it
- Add a score modifier to it
- Rename the score gadget as “Final score”
- Add “Final score” to the name field on the score modifier.
- Set operation type to add in the score modifier
- Add a controller sensor to the chip
- Set it to remote controllable
- Connect the square output to the power port of the score modifier. This will increase our score by 1 everytime you press the square button.
- Add a timer to the chip.
- Change the timer target to 10 seconds.
- Change it to countdown.
- Connect the timer finished (pulse) to post score on the score gadget.
- Add a second timer.
- Connect the first ones timer finished (pulse) to start timer on the new one.
- Make the target time 0.5 seconds.
- Add a doorway to the chip
- Connect timer finished (pulse) on the new timer to the power port on the doorway. This will end the game 0.5 seconds after you post the score to the scoreboard.
- Add 2 number displayers to the chip
- On the score gadget connect current score to the number/range input of displayer 1
- Move number displayer 1 to display in the middle of the screen
- On the original timer connect current time to the number/range of number displayer 2
- Set the display format to time and enable show milliseconds.
- Quick save the level
- Save the level online as private
- Exit to the dreamiverse and create a Dream
- Search for your saved level and add it
- Save the Dream online as private
- Play the Dream by pressing the square button as many times as you can before the timer runs out.
- Your score will be added to a scoreboard after you do this the first time.
- Initial Score
Use this slider to set the initial score that a player will start with. Notice there are no inputs or outputs here – it’s not a value you would expect to change or read during a game.
- Current Score
This output provides the current numeric score – wire it into any other logic you want to be dependent on the score, or perhaps just a Number Displayer gadget.
Toggle this option to assert whether (if on) the scoring is separate for each player in a multiplayer game, or (if off) shared.
- Score Increased
This outputs a brief signal every time the score is increased. You might use this perhaps to play a sound effect or animate sparkles over the score display.
- Score Decreased
This outputs a brief signal every time the score is decreased. You might use this to play a less-than-enthusiastic sound effect at this point (assuming low scores are worse than high scores here).
- Post Score
Sending an input to this tweak will cause the player’s score to be uploaded to the Dream’s scoreboard! Best saved for the end of a game, perhaps as part of the exit/restart logic.
This is where you can turn the gadget on/off.
Although you can use the score gadget as your main score display if you attach a number displayer to it, what you cannot do is pass that number through a level link. So I recommend having your score in a persistent variable for purposes of display and any player levelling code you may have and pass that to the score gadget through a modifier so you have the same number in two separate gadgets – one variable and one score. The persistent variable will maintain scores through level links and pass that to the modifier which in turn will change the score. The score does not need to be only created at the point of game end, and can happily tick up without passing any of that information anywhere throught the game, only to post the score when prompted.
v1.02 (6 Jun 2019) Added LexTips and Useful Tutorial Links.