当前位置: 首页>>代码示例>>Java>>正文


Java GameHelper类代码示例

本文整理汇总了Java中com.google.example.games.basegameutils.GameHelper的典型用法代码示例。如果您正苦于以下问题:Java GameHelper类的具体用法?Java GameHelper怎么用?Java GameHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GameHelper类属于com.google.example.games.basegameutils包,在下文中一共展示了GameHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);

    AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
    config.hideStatusBar = true;
    config.useAccelerometer = true;

    gameHelper.setup(this);

    playServices = new PlayServices(this, gameHelper);

    initialize(new Armadillo(playServices), config);
}
 
开发者ID:AndreFCruz,项目名称:feup-lpoo-armadillo,代码行数:20,代码来源:AndroidLauncher.java

示例2: onCreate

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
@Override
protected void onCreate (Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);
	AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
	config.useImmersiveMode = true;
	gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
	gameHelper.enableDebugLog(false);

	GameHelper.GameHelperListener gameHelperListener = new GameHelper.GameHelperListener()
	{
		@Override
		public void onSignInFailed(){ }

		@Override
		public void onSignInSucceeded(){ }
	};

	gameHelper.setup(gameHelperListener);
	AdBuddiz.setPublisherKey("9bfbf1bb-a9e2-4ce5-8dfd-f25455ceb714");
	AdBuddiz.cacheAds(this);
	initialize(new Application(this, this, this, Application.Platform.ANDROID), config);
	setupAds();
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:25,代码来源:AndroidLauncher.java

示例3: onCreate

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
@Override
protected void onCreate (Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
       pong = new Pong(this);
	initialize(pong, config);

       gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
       gameHelper.enableDebugLog(true);

       GameHelper.GameHelperListener gameHelperListener = new GameHelper.GameHelperListener()
       {
           @Override
           public void onSignInFailed(){ }

           @Override
           public void onSignInSucceeded(){ }
       };

       gameHelper.setup(gameHelperListener);

   }
 
开发者ID:CODA-Masters,项目名称:Pong-Tutorial,代码行数:23,代码来源:AndroidLauncher.java

示例4: MainActivity

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
public MainActivity() {
	aHelper = new GameHelper(this);
	aHelper.enableDebugLog(true, "MYTAG");

	// create a listener for getting raw data back from leaderboard
	theLeaderboardListener = new OnLeaderboardScoresLoadedListener() {

		@Override
		public void onLeaderboardScoresLoaded(int statusCode,
				LeaderboardBuffer leaderboard, LeaderboardScoreBuffer scores) {

			for (int i = 0; i < scores.getCount(); i++) {
				System.out.println(scores.get(i)
						.getScoreHolderDisplayName()
						+ " : "
						+ scores.get(i).getDisplayScore());
			}
		}
	};
}
 
开发者ID:bitbrain,项目名称:plox,代码行数:21,代码来源:MainActivity.java

示例5: setupHelper

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
private void setupHelper() {
	int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
	if (result == ConnectionResult.SUCCESS && PreferenceManager.getDefaultSharedPreferences(this).getBoolean("sign_in", true)) {
		ConnectivityManager connec = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
		if (!signingIn && connec != null && (connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED) || (connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED)) {
			helper = new GameHelper(this, GameHelper.CLIENT_GAMES);
			helper.setMaxAutoSignInAttempts(0);
			helper.setup(this);
			helper.beginUserInitiatedSignIn();
			signingIn = true;
		}
	} else {
		if (!updating) {
			updating = true;
			GooglePlayServicesUtil.showErrorDialogFragment(result, this, 101, new OnCancelListener() {
				@Override
				public void onCancel(DialogInterface dialog) {
					PreferenceManager.getDefaultSharedPreferences(MainActivity.this).edit().putBoolean("play_services_opt_out", true).putBoolean("sign_in", false).apply();
				}
			});
		} else {
			PreferenceManager.getDefaultSharedPreferences(MainActivity.this).edit().putBoolean("play_services_opt_out", true).putBoolean("sign_in", false).apply();
		}
	}
}
 
开发者ID:ellenpoe,项目名称:BlitzCalc,代码行数:26,代码来源:MainActivity.java

示例6: MainActivity

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
public MainActivity() {
	aHelper = new GameHelper(this);
	aHelper.enableDebugLog(true, "MYTAG");

	// create a listener for getting raw data back from leaderboard
	theLeaderboardListener = new OnLeaderboardScoresLoadedListener() {

		@Override
		public void onLeaderboardScoresLoaded(int statusCode,
				LeaderboardBuffer leaderboard, LeaderboardScoreBuffer scores) {
			System.out.println("In call back");

			for (int i = 0; i < scores.getCount(); i++) {
				System.out.println(scores.get(i)
						.getScoreHolderDisplayName()
						+ " : "
						+ scores.get(i).getDisplayScore());
			}
		}
	};
}
 
开发者ID:bitbrain,项目名称:acid-snake,代码行数:22,代码来源:MainActivity.java

示例7: onCreate

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
@Override
protected void onCreate (Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	String pKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk7CvCwFg6zjMPmczjAxaLlUjiriAudAOS1a+AFAC5KsA1ZeK7dW8g2spFW7ukmLaSAKQWqGgaKwrs+hntgbMsp2cPWe1x77z8gISdXUNZB2XuzjZqUTzRaGU3zoO9kjBAqQmSaZIo7hLb2hn70Yzeoo31fV4m1koHsNtzpMUksYpFwuD/HVJifHeO9E1bvea6ljidGtYz10hdoF/t+Lp77Exv/17pD9IbE8dKO/j0p/MFIAz0LF1+vyhg/bhpZs2X8Y3dWVv3fkthScj4Wemu8yDksTpCH6baDwjeZ5qe7eAoA3KnQsR7kssiUNXWWtUTUOON1GlOqcHVu9BJW52GwIDAQAB";
	gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
	gameHelper.enableDebugLog(false);

	bp = new BillingProcessor(this, pKey, this);

	GameHelper.GameHelperListener gameHelperListener = new GameHelper.GameHelperListener() {
		@Override
		public void onSignInFailed() {

		}

		@Override
		public void onSignInSucceeded() {

		}
	};

	gameHelper.setup(gameHelperListener);

	AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
	initialize(new Hexpert(this, this, this), config);
}
 
开发者ID:MartensCedric,项目名称:Hexpert,代码行数:28,代码来源:AndroidLauncher.java

示例8: onCreate

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
@Override
protected void onCreate (Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
	AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();

	reversi = new Reversi(this);
	initialize(reversi, config);
	gameHelper.setup(this);
}
 
开发者ID:antonioalmeida,项目名称:retro-reversi,代码行数:11,代码来源:AndroidLauncher.java

示例9: updatePlayButtons

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
private void updatePlayButtons() {
    GameHelper gameHelper = getYassActivity().getGameHelper();
    if (gameHelper.isConnecting() || gameHelper.isSignedIn()) {
        getView().findViewById(R.id.btn_achievements).setVisibility(View.VISIBLE);
        getView().findViewById(R.id.btn_leaderboards).setVisibility(View.VISIBLE);
        getView().findViewById(R.id.btn_sign_in).setVisibility(View.GONE);
    }
    else {
        getView().findViewById(R.id.btn_achievements).setVisibility(View.GONE);
        getView().findViewById(R.id.btn_leaderboards).setVisibility(View.GONE);
        getView().findViewById(R.id.btn_sign_in).setVisibility(View.VISIBLE);
    }
}
 
开发者ID:PacktPublishing,项目名称:Android-Game-Programming,代码行数:14,代码来源:MainMenuFragment.java

示例10: setupGameHelper

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
private void setupGameHelper(Activity activity)
{
    this.gameHelper = new GameHelper(activity, GameHelper.CLIENT_GAMES);
    this.gameHelper.enableDebugLog(Constants.General.IS_DEBUGGING);

    GameHelper.GameHelperListener gameHelperListener = new GameHelper.GameHelperListener()
    {
        @Override
        public void onSignInFailed()
        {
        }

        @Override
        public void onSignInSucceeded()
        {
            Runnable onSignInSucceededRunnable =
                AndroidServices.this.onGoogleSignInSucceededRunnable;
            if (onSignInSucceededRunnable != null)
            {
                AndroidServices.this.onGoogleSignInSucceededRunnable = null;
                onSignInSucceededRunnable.run();
            }
        }
    };

    this.gameHelper.setup(gameHelperListener);
}
 
开发者ID:overengineering,项目名称:space-travels-3,代码行数:28,代码来源:AndroidServices.java

示例11: onCreate

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);

	// Create the GameHelper.
	_gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
	_gameHelper.enableDebugLog(false);

	resetMultiplayerProperties();

	GameHelper.GameHelperListener gameHelperListener = new GameHelper.GameHelperListener()
	{
		@Override
		public void onSignInSucceeded(){
		}

		@Override
		public void onSignInFailed(){
		}
	};

	_gameHelper.setup(gameHelperListener);

	AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
	PlatformAndroid platform = new PlatformAndroid();
	platform.setActivity(this);

	getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

	initialize(new SpaceGame(platform, this), config);
}
 
开发者ID:SpaceGame-ETSII,项目名称:spacegame,代码行数:33,代码来源:AndroidLauncher.java

示例12: onCreate

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
  aHelper = new GameHelper(this, GameHelper.CLIENT_ALL);
  aHelper.setup(this);
  initialize(new ClouBoy(this), config);
}
 
开发者ID:bitbrain,项目名称:clouboy,代码行数:9,代码来源:AndroidLauncher.java

示例13: AndroidGameServices

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
public AndroidGameServices(Activity activity, int clientsToUse) {
        this.activity = activity;
        gameHelper = new GameHelper(this.activity, clientsToUse);
        gameHelper.setMaxAutoSignInAttempts(MAX_AUTO_SIGN_IN_ATTEMPTS);
        gameHelper.setup(this);
        gameHelper.enableDebugLog(true);
//      isSavedGamesLoadDone = false;

        initQuestConstants();
    }
 
开发者ID:UnderwaterApps,项目名称:submarine,代码行数:11,代码来源:AndroidGameServices.java

示例14: onCreate

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		//		 Create the GameHelper
		_gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
		_gameHelper.enableDebugLog(false);

		GameHelperListener gameHelperListener = new GameHelper.GameHelperListener() {

			@Override
			public void onSignInSucceeded() {
				// TODO Auto-generated method stub

			}

			@Override
			public void onSignInFailed() {
				// TODO Auto-generated method stub

			}
		};

		_gameHelper.setup(gameHelperListener);
		
//		signIn();
		
		Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
		serviceIntent.setPackage("com.android.vending");
		bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
//		queryPurchases();
		
		AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
		config.useImmersiveMode = true;
		initialize(new Runners(this), config);
	}
 
开发者ID:RyanMan56,项目名称:Runners,代码行数:37,代码来源:AndroidLauncher.java

示例15: onCreate

import com.google.example.games.basegameutils.GameHelper; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_game);

	int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
	if (result == ConnectionResult.SUCCESS && PreferenceManager.getDefaultSharedPreferences(this).getBoolean("sign_in", true)) {
		ConnectivityManager connec = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
		if (connec != null && (connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED) || (connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED)) {
			helper = new GameHelper(this, GameHelper.CLIENT_GAMES);
			helper.setMaxAutoSignInAttempts(0);
			helper.setup(this);
		}
	}

	if (getIntent().getExtras() != null) {
		isChallenge = getIntent().getExtras().getBoolean("challenge");
	}

	rand = new Random();

	// FRAGMENTS

	if (savedInstanceState == null) {
		gameFrag = new GameFragment();
		gameFrag.setListener(this);
		setModeGame();

		gameOverFrag = new GameOverFragment();
		gameOverFrag.setListener(this);
	}

}
 
开发者ID:ellenpoe,项目名称:BlitzCalc,代码行数:34,代码来源:GameActivity.java


注:本文中的com.google.example.games.basegameutils.GameHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。