Top Quality Products

Street Basketball with AdMob and Leaderboard

$18.00

Added to wishlistRemoved from wishlist 0
Add to compare

42 sales

Street Basketball with AdMob and Leaderboard

Street Basketball with AdMob and Leaderboard Review

Get ready to hit the court with Street Basketball, a LibGDX game coded in Java and optimized for Android devices. This engaging game is sure to keep you entertained for hours on end.

Gameplay

The gameplay is simple yet challenging. Touch and move your finger on the screen to set the power and vector of the ball trajectory. The goal is to score as many points as possible within the allotted time. Every goal gives you extra time to play, making it a thrilling experience.

Features

What sets Street Basketball apart from other basketball games is its impressive feature list:

  • AdMob Banner and Interstitial ads integrated for monetization
  • Google Play Games Leaderboard integrated to compete with friends and others
  • Clear and vibrant graphics that bring the court to life
  • Optimized for tablets for a more immersive experience
  • Background music and sounds that enhance the overall atmosphere

Setup and Reskin

If you’re interested in setting up and reskinning the game, the process is straightforward:

  • Install the latest Android SDK
  • Open the Gradle project in Android Studio
  • Change Package ID, App Name, icons, graphics, and sounds to your liking
  • Set up Google Play Games Services
  • Set up AdMob ID, Google Play Games App ID, and Leaderboard ID
  • Build an APK file

Credits

The background music for Street Basketball is "Trial and Error" from playonloop.com.

User Reviews

0.0 out of 5
0
0
0
0
0
Write a review

There are no reviews yet.

Be the first to review “Street Basketball with AdMob and Leaderboard”

Your email address will not be published. Required fields are marked *

Introduction

Welcome to the comprehensive tutorial on how to integrate Street Basketball with AdMob and Leaderboard! In this tutorial, we will guide you through the process of adding AdMob ads to your Street Basketball game and setting up a leaderboard to track high scores. By the end of this tutorial, you will have a fully functional Street Basketball game with AdMob ads and a leaderboard.

Prerequisites

Before we begin, make sure you have the following:

  • A basic understanding of Android game development and Java programming
  • The Street Basketball game code (you can download it from the GitHub repository)
  • The AdMob SDK (you can download it from the AdMob website)
  • The Google Play Services SDK (you can download it from the Google Play website)

Step 1: Set up AdMob

To start, you need to set up an AdMob account and create a new ad unit. Follow these steps:

  1. Go to the AdMob website and sign up for an account if you don't already have one.
  2. Create a new ad unit by clicking on the "Create Ad Unit" button.
  3. Choose the ad format you want to use (e.g. interstitial, rewarded video, etc.).
  4. Set up the ad unit settings according to your preferences.
  5. Get the AdMob SDK and add it to your Street Basketball project.

Step 2: Add AdMob to your Street Basketball game

Now that you have set up your AdMob account and created an ad unit, it's time to add the AdMob SDK to your Street Basketball game. Follow these steps:

  1. In your Street Basketball project, create a new Java class called AdMobManager.
  2. In the AdMobManager class, import the AdMob SDK and initialize the AdMob instance.
  3. Load the ad unit you created earlier into the AdMob instance.
  4. Use the AdMob instance to show ads at specific points in your game (e.g. after a level is completed).

Here is some sample code to get you started:

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.MobileAds;

public class AdMobManager {
    private AdView adView;

    public AdMobManager() {
        MobileAds.initialize(this);
        AdRequest adRequest = new AdRequest.Builder().build();
        adView = new AdView(this);
        adView.setAdUnitId("YOUR_AD_UNIT_ID");
        adView.loadAd(adRequest);
    }

    public void showAd() {
        adView.show();
    }
}

Step 3: Set up the Leaderboard

To set up the leaderboard, you will need to create a new Google Play Game Services leaderboard. Follow these steps:

  1. Go to the Google Play Console and sign in with your Google account.
  2. Click on the "Games" tab and select your Street Basketball game.
  3. Click on the "Leaderboards" tab and click on the "Create Leaderboard" button.
  4. Set up the leaderboard settings according to your preferences.
  5. Get the leaderboard ID and add it to your Street Basketball game.

Step 4: Integrate the Leaderboard with your Street Basketball game

Now that you have set up the leaderboard, it's time to integrate it with your Street Basketball game. Follow these steps:

  1. In your Street Basketball game, create a new Java class called LeaderboardManager.
  2. In the LeaderboardManager class, import the Google Play Games SDK and initialize the Google Play Games instance.
  3. Use the Google Play Games instance to submit scores to the leaderboard.
  4. Use the Google Play Games instance to retrieve the leaderboard data and display it in your game.

Here is some sample code to get you started:

import com.google.android.gms.games.Games;
import com.google.android.gms.games.Leaderboards;
import com.google.android.gms.games.Leaderboards.OnLeaderboardResultListener;

public class LeaderboardManager {
    private Leaderboards leaderboards;

    public LeaderboardManager() {
        leaderboards = Games.getLeaderboardsApi();
    }

    public void submitScore(int score) {
        leaderboards.submitScore(LEADERBOARD_ID, score);
    }

    public void getLeaderboardData(OnLeaderboardResultListener listener) {
        leaderboards.getLeaderboard(LAST_7_DAYS, listener);
    }
}

Step 5: Implement AdMob and Leaderboard in your Street Basketball game

Now that you have set up AdMob and the leaderboard, it's time to implement them in your Street Basketball game. Follow these steps:

  1. In your Street Basketball game, create a new Java class called GameActivity.
  2. In the GameActivity class, initialize the AdMob instance and the LeaderboardManager instance.
  3. Use the AdMob instance to show ads at specific points in the game.
  4. Use the LeaderboardManager instance to submit scores to the leaderboard and retrieve leaderboard data.

Here is some sample code to get you started:

import android.os.Bundle;
import android.widget.Toast;

public class GameActivity extends AppCompatActivity {
    private AdMobManager adMobManager;
    private LeaderboardManager leaderboardManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        adMobManager = new AdMobManager();
        leaderboardManager = new LeaderboardManager();
    }

    public void showAd() {
        adMobManager.showAd();
    }

    public void submitScore(int score) {
        leaderboardManager.submitScore(score);
    }

    public void getLeaderboardData(OnLeaderboardResultListener listener) {
        leaderboardManager.getLeaderboardData(listener);
    }
}

That's it! With these steps, you should now have a fully functional Street Basketball game with AdMob ads and a leaderboard. Remember to replace the placeholder code with your own implementation and adjust the settings according to your preferences. Happy coding!

AdMob Settings

In the string.xml file, add the following AdMob configuration:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="admob_app_id">your_admob_app_id</string>
    <string name="admob_banner_ad_unit_id">your_admob_banner_ad_unit_id</string>
    <string name="admob_interstitial_ad_unit_id">your_admob_interstitial_ad_unit_id</string>
</resources>

Replace your_admob_app_id, your_admob_banner_ad_unit_id, and your_admob_interstitial_ad_unit_id with your actual AdMob App ID and ad unit IDs.

Leaderboard Settings

In the strings.xml file, add the following leaderboard configuration:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="leaderboard_api_key">your_google_play_services_api_key</string>
    <string name="leaderboard_xml_url">leaderboard_url.xml</string>
</resources>

Replace your_google_play_services_api_key with your actual Google Play Services API key and leaderboard_url.xml with the path to your leaderboard XML file.

Leaderboard XML File

Create a new XML file called leaderboard_url.xml in the res/values directory and add the following content:

<?xml version="1.0" encoding="utf-8"?>
<leaderboard>
    <header>
        <scoreRule leaderBoardTable="YOUR_LEADERBOARD_TABLE">
            <name>Scores</name>
            <category>
                <type>PLAYER_LEVEL</type>
            </category>
        </scoreRule>
    </header>
</leaderboard>

Replace YOUR_LEADERBOARD_TABLE with the actual ID of your leaderboard table.

Java Code Settings

In the GameActivity.java file, add the following AdMob initialization code:

// Initialize AdMob
MobileAds.initialize(this, getResources().getString(R.string.admob_app_id));
AdView adView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);

And in the ScoreManager.java file, add the following leaderboard initialization code:

// Initialize leaderboard
 LeaderboardConfig leaderboardConfig = new LeaderboardConfig(this);
 leaderboardConfig.setLeaderboardId(getString(R.string.leaderboard_api_key));
 leaderboardConfig.setRangeType(LeaderboardConfig.RANGE_TYPE_GLOBAL);
 LeaderboardScore.score(this, leaderboardConfig);

Replace YOUR_LEADERBOARD_TABLE with the actual ID of your leaderboard table.

Here are the features mentioned about the Street Basketball game:

  1. AdMob Banner integrated: The game features AdMob banners, allowing for in-app advertising.
  2. AdMob Interstitial integrated: The game also features AdMob interstitial ads, which appear full-screen.
  3. Google Play Games Leaderboard integrated: The game integrates Google Play Games Leaderboards, allowing for competitive leaderboards and achievements.
  4. Clear graphics: The game has clear and visually appealing graphics.
  5. Optimized for tablets: The game is optimized for tablets, making it suitable for play on larger screens.
  6. Background music and sounds: The game features background music and sound effects.

Additionally, the game allows you to:

  • Set the power and vector of the ball trajectory by touching and moving your finger on the screen.
  • Earn more time to play after each goal scored.
  • Download and try the demo version of the game.

Let me know if you'd like me to extract any other information from this content!

Street Basketball with AdMob and Leaderboard
Street Basketball with AdMob and Leaderboard

$18.00

Shop.Vyeron.com
Logo
Compare items
  • Total (0)
Compare
0