Android Open Source - Freebloks-Android Global






From Project

Back to project page Freebloks-Android.

License

The source code is released under:

GNU General Public License

If you think the Android project Freebloks-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.saschahlusiak.freebloks;
/* www  . j a  va2 s .c  om*/
import de.saschahlusiak.freebloks.controller.GameMode;
import android.graphics.Color;

public class Global {
  public final static int VIBRATE_START_DRAGGING = 85;
  public final static int VIBRATE_SET_STONE = 65;
  public final static int VIBRATE_STONE_SNAP = 40;

  /* minimum number of starts before rating dialog appears */
  public final static int RATE_MIN_STARTS = 8;

  /* minimum elapsed time after first start, before rating dialog appears */
  public static final long RATE_MIN_ELAPSED = 4 * (24 * 60 * 60 * 1000);

  /* number of starts before the donate dialog appears */
  public final static int DONATE_STARTS = 50;

  /* the default server address: blokus.saschahlusiak.de */
  public static final String DEFAULT_SERVER_ADDRESS = "blokus.saschahlusiak.de";


  public final static String base64EncodedPublicKey =
      "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsV2nQN/odu41MVs9jWCUiFBYlEKh+s+NeT81970AJo1t/0o+n46sQhxBBRuPAGPKiUPH1QEWwM+JgfNdaHjAX66D2Y4KlpQRu/u3hJjnRzn0hYWMOyjhhP06Dr+CKNworbRGdAbvWcUtkxjDXdixYExfIvX5Kdt/84evRzFjW/9JgpTYbqPnOt6qo1cuJkRfGKADTGbjk2POLY/s+tlcYrNUJScNBDgjfSgrY1fDAbv6T0JY+HaDkQSFfnb+W+nNZ6N/1pLizTjAX9/A5iZVc058jrFV0utXXpAd9b/CtxjETF/WnfXBVmdue+glG4WlacIZMpq2x6r09pJ2HbbOsQIDAQAB";

  /* set to true for Amazon export */
  public final static boolean IS_AMAZON = false;


  public final static String getMarketURLString(String packageName) {
    if (IS_AMAZON)
      return "http://www.amazon.com/gp/mas/dl/android?p=" + packageName;
    else
      return "https://play.google.com/store/apps/details?id=" + packageName;
  }


  public static final int PLAYER_BACKGROUND_COLOR[] = {
    Color.rgb(92, 92, 92),  /* white */
    Color.rgb(0, 0, 128),  /* blue */
    Color.rgb(140, 140, 0),  /* yellow */
    Color.rgb(96, 0, 0),  /* red */
    Color.rgb(0, 96, 0),  /* green */
    Color.rgb(170, 96, 24),  /* orange */
    Color.rgb(96, 0, 140)  /* purple */
  };

  public static final int PLAYER_FOREGROUND_COLOR[] = {
    Color.rgb(255, 255, 255),  /* white */
    Color.rgb(0, 160, 255),  /* blue */
    Color.rgb(255, 255, 0),  /* yellow */
    Color.rgb(255, 0, 0),  /* red */
    Color.rgb(0, 255, 0),  /* green */
    Color.rgb(255, 140, 92),/* orange */
    Color.rgb(180, 64, 255),/* purple */
  };

  final static float stone_white[]={0.7f, 0.7f, 0.7f, 0};
  final static float stone_red[]={0.75f, 0, 0, 0};
  final static float stone_blue[]={0.0f, 0.2f, 1.0f, 0};
  final static float stone_green[]={0.0f, 0.65f, 0, 0};
  final static float stone_yellow[]={0.80f, 0.80f, 0, 0};
  final static float stone_orange[]={0.90f, 0.40f, 0.0f, 0};
  final static float stone_purple[]={0.40f, 0.0f, 0.80f, 0};
  public final static float stone_color_a[][] = { stone_white, stone_blue, stone_yellow, stone_red, stone_green, stone_orange, stone_purple };

  final static float stone_red_dark[]={0.035f, 0, 0, 0};
  final static float stone_blue_dark[]={0.0f, 0.004f, 0.035f, 0};
  final static float stone_green_dark[]={0.0f, 0.035f, 0, 0};
  final static float stone_yellow_dark[]={0.025f, 0.025f, 0, 0};
  final static float stone_orange_dark[]={0.040f, 0.020f, 0, 0};
  final static float stone_purple_dark[]={0.020f, 0.000f, 0.040f, 0};
  final static float stone_white_dark[]={0.04f, 0.04f, 0.04f, 0};
  public final static float stone_shadow_color_a[][] = { stone_white_dark, stone_blue_dark, stone_yellow_dark, stone_red_dark, stone_green_dark, stone_orange_dark, stone_purple_dark };

  public final static int getPlayerColor(int player, GameMode game_mode) {
    if (game_mode == GameMode.GAMEMODE_DUO || game_mode == GameMode.GAMEMODE_JUNIOR) {
      /* player 1 is orange */
      if (player == 0)
        return 5;
      /* player 2 is purple */
      if (player == 2)
        return 6;
    }
    return player + 1;
  }
}




Java Source Code List

com.google.example.games.basegameutils.BaseGameActivity.java
com.google.example.games.basegameutils.GameHelperUtils.java
com.google.example.games.basegameutils.GameHelper.java
de.saschahlusiak.freebloks.AboutActivity.java
de.saschahlusiak.freebloks.Global.java
de.saschahlusiak.freebloks.backup.FreebloksBackupAgent.java
de.saschahlusiak.freebloks.controller.GameMode.java
de.saschahlusiak.freebloks.controller.JNIServer.java
de.saschahlusiak.freebloks.controller.PlayerData.java
de.saschahlusiak.freebloks.controller.SpielClientInterface.java
de.saschahlusiak.freebloks.controller.SpielClient.java
de.saschahlusiak.freebloks.controller.Spielleiter.java
de.saschahlusiak.freebloks.database.FreebloksDBOpenHandler.java
de.saschahlusiak.freebloks.database.FreebloksDB.java
de.saschahlusiak.freebloks.database.HighscoreDB.java
de.saschahlusiak.freebloks.donate.DonateActivity.java
de.saschahlusiak.freebloks.game.ActivityInterface.java
de.saschahlusiak.freebloks.game.AddScoreTask.java
de.saschahlusiak.freebloks.game.CustomGameDialog.java
de.saschahlusiak.freebloks.game.FreebloksActivity.java
de.saschahlusiak.freebloks.game.GameFinishActivity.java
de.saschahlusiak.freebloks.game.GameMenu.java
de.saschahlusiak.freebloks.game.RateAppDialog.java
de.saschahlusiak.freebloks.game.RetainedConfig.java
de.saschahlusiak.freebloks.game.SpielClientThread.java
de.saschahlusiak.freebloks.lobby.ChatEntry.java
de.saschahlusiak.freebloks.lobby.ChatListAdapter.java
de.saschahlusiak.freebloks.lobby.ColorAdapter.java
de.saschahlusiak.freebloks.lobby.LobbyDialog.java
de.saschahlusiak.freebloks.model.Player.java
de.saschahlusiak.freebloks.model.Spiel.java
de.saschahlusiak.freebloks.model.Stone.java
de.saschahlusiak.freebloks.model.Turn.java
de.saschahlusiak.freebloks.model.Turnpool.java
de.saschahlusiak.freebloks.network.NET_CHAT.java
de.saschahlusiak.freebloks.network.NET_CURRENT_PLAYER.java
de.saschahlusiak.freebloks.network.NET_GAME_FINISH.java
de.saschahlusiak.freebloks.network.NET_GRANT_PLAYER.java
de.saschahlusiak.freebloks.network.NET_HEADER.java
de.saschahlusiak.freebloks.network.NET_REQUEST_GAME_MODE.java
de.saschahlusiak.freebloks.network.NET_REQUEST_HINT.java
de.saschahlusiak.freebloks.network.NET_REQUEST_PLAYER.java
de.saschahlusiak.freebloks.network.NET_REQUEST_UNDO.java
de.saschahlusiak.freebloks.network.NET_REVOKE_PLAYER.java
de.saschahlusiak.freebloks.network.NET_SERVER_STATUS.java
de.saschahlusiak.freebloks.network.NET_SET_STONE.java
de.saschahlusiak.freebloks.network.NET_START_GAME.java
de.saschahlusiak.freebloks.network.NET_UNDO_STONE.java
de.saschahlusiak.freebloks.network.Network.java
de.saschahlusiak.freebloks.preferences.AboutFragment.java
de.saschahlusiak.freebloks.preferences.DisplayFragment.java
de.saschahlusiak.freebloks.preferences.FreebloksPreferences.java
de.saschahlusiak.freebloks.preferences.InterfaceFragment.java
de.saschahlusiak.freebloks.preferences.MiscFragment.java
de.saschahlusiak.freebloks.preferences.StatisticsFragment.java
de.saschahlusiak.freebloks.preferences.ThemePreference.java
de.saschahlusiak.freebloks.stats.StatisticsActivity.java
de.saschahlusiak.freebloks.stats.StatisticsAdapter.java
de.saschahlusiak.freebloks.view.BackgroundRenderer.java
de.saschahlusiak.freebloks.view.BoardRenderer.java
de.saschahlusiak.freebloks.view.Freebloks3DView.java
de.saschahlusiak.freebloks.view.FreebloksRenderer.java
de.saschahlusiak.freebloks.view.SimpleModel.java
de.saschahlusiak.freebloks.view.effects.AbsEffect.java
de.saschahlusiak.freebloks.view.effects.AbsStoneEffect.java
de.saschahlusiak.freebloks.view.effects.BoardStoneGlowEffect.java
de.saschahlusiak.freebloks.view.effects.EffectSet.java
de.saschahlusiak.freebloks.view.effects.Effect.java
de.saschahlusiak.freebloks.view.effects.PhysicalStoneEffect.java
de.saschahlusiak.freebloks.view.effects.StoneFadeEffect.java
de.saschahlusiak.freebloks.view.effects.StoneRollEffect.java
de.saschahlusiak.freebloks.view.effects.StoneUndoEffect.java
de.saschahlusiak.freebloks.view.model.Board.java
de.saschahlusiak.freebloks.view.model.CurrentStone.java
de.saschahlusiak.freebloks.view.model.Intro.java
de.saschahlusiak.freebloks.view.model.Sounds.java
de.saschahlusiak.freebloks.view.model.Theme.java
de.saschahlusiak.freebloks.view.model.ViewElement.java
de.saschahlusiak.freebloks.view.model.ViewModel.java
de.saschahlusiak.freebloks.view.model.Wheel.java