
Overview
Welcome to the "A Beamable Clicker" (ABC) game.
This downloadable sample project showcases the Beamable Leaderboard Flow FeatureFeature - An individual aspect of the Beamable product used to create a great user experience.
within the time limit.
This document and the sample project allow game makers to understand and apply the benefits of a LeaderboardLeaderboard - A list of high scores by all players of a game in game development. Or watch this video.
Download
These learning resources provide a better way to build live games in Unity.
Source | Detail |
---|---|
![]() ![]() |
Note: Each sample project is compatible with Mac & Windows and includes the Beamable SDK. Each sample project requires internet connectivity. |
Screenshots
The player navigates from the Intro Scene to the Game Scene, where all the action takes place. The Leaderboard scene shows the high scores by all players of the game.
Intro Scene | Game Scene | Leaderboard Scene | Project |
---|---|---|---|
![]() ![]() | ![]() ![]() | ![]() ![]() | ![]() ![]() |
Player Experience Flowchart
Here is the high level execution flow of user input and system interactions.
Game Maker User Experience
During development, the game maker's user experience is as follows. There are 3 major parts to this game creation process.
Steps
Follow these steps to get started.
These steps are already complete in the sample project. The instructions here explain the process.
Related Feature
The background info and basic functionality are covered in the feature page. See Leaderboard Flow for more info.
Step 1. Setup The Project
Step | Detail |
---|---|
| ⢠See Step 1 - Getting Started for more info |
Step 2. Create Content
Step | Detail |
---|---|
| ⢠See Adding Stats for more info |
| ⢠See Adding Stats for more info |
| ⢠Unity ā Window ā Beamable ā Open Content Manager |
| ⢠Click the |
| ![]() ![]() |
| ![]() ![]() NOTE: With |
| ⢠Unity ā File ā Save Project Best Practice: If you are working on a team, commit to version control in this step. |
| ⢠Press the "Publish" button in the Content Manager Window |
Step 3. Create Game Code
Name | Detail |
---|---|
| ⢠Implement game logic Note: This represents the bulk of the development effort. The details depend on the specifics of the game project. |
| ⢠Unity ā Edit ā Play |
| ⢠Can you beat the high score? |
| ⢠Unity ā Edit ā Stop |
Code
Here are a few highlights from the project's major classes.
In the interest of brevity, these code embeds are incomplete. Download the project to see the complete code.
The IntroSceneManager
uses Beamable's ConnectivityService
to check internet availability.
namespace Beamable.Samples.ABC
{
public class IntroSceneManager : MonoBehaviour
{
// Fields ---------------------------------------
private IDisruptorEngine _disruptorEngine = null;
// Unity Methods ------------------------------
protected void Start()
{
DisruptorEngine.Instance.Then(de =>
{
_disruptorEngine = de;
_disruptorEngine.ConnectivityService.OnConnectivityChanged += ConnectivityService_OnConnectivityChanged;
ConnectivityService_OnConnectivityChanged(_disruptorEngine.ConnectivityService.HasConnectivity);
});
}
// Event Handlers -------------------------------
private void ConnectivityService_OnConnectivityChanged(bool isConnected)
{
//React to changes in connectivity
}
// Other Code (Not Shown) ... -----------------
}
}
The GameSceneManager
uses Beamable's StatBehaviour
to set/get player-specific stored values and uses Beamable's LeaderboardService
upon victory to submit the player-specific score.
namespace Beamable.Samples.ABC
{
public class GameSceneManager : MonoBehaviour
{
// Fields ---------------------------------------
[SerializeField]
private TreeView _treeView = null;
[SerializeField]
private StatBehaviour _currentScoreStatBehaviour = null;
private IDisruptorEngine _disruptorEngine = null;
// Unity Methods ------------------------------
protected void Start ()
{
_currentScoreStatBehaviour.OnStatReceived.AddListener(
CurrentScoreStatBehaviour_OnStatReceived);
DisruptorEngine.Instance.Then(de =>
{
_disruptorEngine = de;
});
}
// Other Methods --------------------------------
private void SetLeaderboardScore(LeaderboardContent leaderboardContent, double score)
{
_disruptorEngine.LeaderboardService.SetScore(leaderboardContent.Id, score);
}
// Event Handlers -------------------------------
private void CurrentScoreStatBehaviour_OnStatReceived(string currentScore)
{
float targetHighScore = 30;
float growthPercentageOf100 = (100 * Int32.Parse(currentScore)) / targetHighScore;
_treeView.GrowthPercentage = Mathf.Clamp01(growthPercentageOf100 / 100);
}
// Other Code (Not Shown) ... -----------------
}
}
Additional Experiments
Here some optional experiments game makers can perform with the sample project.
Did you complete all the experiments with success? We'd love to hear about it. Contact us.
Difficulty | Scene | Name | Detail |
---|---|---|---|
Beginner | Game | Tweak | ⢠See
|
Beginner | Game | Add new Input | ⢠The current game uses mouse-clicks as input for core game play.
|
Intermediate | Game | Add 3 Difficulty Levels | ⢠The current game has a set difficulty and set level duration.
|
Advanced | Game | Add 3 Types of Trees | ⢠The current game has one
|
Advanced
Here are a few advanced configuration options and workflows.
Using Beamable Stats
Beamable StatStat - Active data entity used for read/write of player states are a simple place to read/write info (Ex. How many characters does the player own?)
See Adding Stats for more info
More Info
⢠Strictly speaking, this sample project's needs do not require Beamable StatStat - Active data entity used for read/write of player states.
⢠The feature is included in this sample project for educational purposes.
Managing Leaderboard Via Portal
The Portal allows the game maker to manage LeaderboardLeaderboard - A list of high scores by all players of a games.
See Leaderboard Flow for more info.
Learning Resources
These learning resources provide a better way to build live games in Unity.
Source | Detail |
---|---|
![]() ![]() |
Note: Each sample project is compatible with Mac & Windows and includes the Beamable SDK. Each sample project requires internet connectivity. |
Updated 19 days ago