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


Java GameHelper.setup方法代码示例

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


在下文中一共展示了GameHelper.setup方法的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: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: onCreate

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

      mGPGSManager = new AndroidGPGSManager(mGameHelper, this);
      
      AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
cfg.useWakelock = true;
cfg.useAccelerometer = true;
      
mGame = new MainGame(mGPGSManager);
mGameHelper.setup(this, GameHelper.CLIENT_GAMES | GameHelper.CLIENT_APPSTATE);
initialize(mGame, cfg);        
  }
 
开发者ID:dbaelz,项目名称:Secludedness,代码行数:16,代码来源:MainActivity.java

示例13: onCreate

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

    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);

    AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
    config.useAccelerometer = false;
    config.useGyroscope = false;

    MobileAds.initialize(this, APP_UNIT_ID);
    vunglePub.init(this, APP_VUNGLE_ID, placement_list, new VungleInitListener() {
        @Override
        public void onSuccess() {
            Log.d(LOG_TAG, "init success");
            vunglePub.clearAndSetEventListeners(vungleDefaultListener);
        }

        @Override
        public void onFailure(Throwable throwable) {

        }
    });


    getWindow().getDecorView().setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

    RelativeLayout layout = new RelativeLayout(this);
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
    layout.setLayoutParams(params);

    createAdView();
    layout.addView(adView);

    createGameView(config);
    layout.addView(gameView);

    setContentView(layout);

    startAdvertising(adView);
}
 
开发者ID:ZephyrVentum,项目名称:FlappySpinner,代码行数:65,代码来源:AndroidLauncher.java

示例14: onCreate

import com.google.example.games.basegameutils.GameHelper; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	
	// Create the layout
       RelativeLayout layout = new RelativeLayout(this);

       // Do the stuff that initialize() would do for you
       requestWindowFeature(Window.FEATURE_NO_TITLE);
       getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
               WindowManager.LayoutParams.FLAG_FULLSCREEN);
       getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

       // Create the libgdx View
       View gameView = initializeForView(new GameListener(this));
       // Add the libgdx view
       layout.addView(gameView);

       // ad mob
       if (areAdsEnabled) {
        // Create and setup the AdMob view
        adView = new AdView(this);
        adView.setAdUnitId(AdUnitId);
        adView.setAdSize(AdSize.BANNER);
        // adView.setAdListener(new ToastAdListener(this));
        AdRequest adRequest = new AdRequest.Builder()
        				   .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
        				   .addTestDevice("425C0AD9758E9E82898D6CDAA982B111")
        				   .build();
        adView.loadAd(adRequest);
                
        // Add the AdMob view
        RelativeLayout.LayoutParams adParams = 
            new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, 
                    RelativeLayout.LayoutParams.WRAP_CONTENT);
        adParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
        adParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);

        layout.addView(adView, adParams);
        adView.setVisibility(View.GONE);
       }

       // achievements and leaderboards
       if (areServicesEnabled) {
       	SharedPreferences sp = getSharedPreferences("GOOGLE_PLAY", Context.MODE_PRIVATE);
       	boolean automaticSignIn = sp.getBoolean("signed_in", false);
       	mHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
       	mHelper.setConnectOnStart(automaticSignIn);
       	if (DEBUG) {
       		mHelper.enableDebugLog(true);
       	}
    	mHelper.setup(this);
       }
      
      // Hook it all up
      setContentView(layout);
}
 
开发者ID:igorcrevar,项目名称:GoingUnder,代码行数:58,代码来源:UndergroundActivity.java

示例15: onCreate

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

	requestWindowFeature(Window.FEATURE_NO_TITLE);
	getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
			WindowManager.LayoutParams.FLAG_FULLSCREEN);
	setContentView(R.layout.activity_main);
	
	mHelper = new GameHelper(this, GameHelper.CLIENT_ALL);
	mHelper.enableDebugLog(true, "GameHelper");
	mHelper.setMaxAutoSignInAttempts(0);
	
	mHelper.setup(new GameHelperListener() {
		@Override
		public void onSignInSucceeded() {
		}
		@Override
		public void onSignInFailed() {
		}
	});
	
	gamesPlayed = 0;
	
	Display display = getWindowManager().getDefaultDisplay();
	screenWidth = display.getWidth();
	screenHeight = display.getHeight();
	initializeFlipViews();
	
	loadGameState();
	
	initializeDrawables();
	levelFactory = getFactory(currentDifficulty);
	playingLevel = null;
	getViewsRefferences();
	nextLevel();
	initializeViews();
	
	saveGameState();
	loadUIState();
	
	Log.e(TAG, "onCreate");
	Log.e(TAG, playingLevel.getGameNum());
	
	setFlipViewsDrawables(playingLevel.getGameNum());
	movesRemaining = playingLevel.getMinMoves();
	saveUIState();
}
 
开发者ID:gorjanz,项目名称:numbers-game,代码行数:49,代码来源:ClassicModeActivity.java


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