Android Open Source - crabox Cbx






From Project

Back to project page crabox.

License

The source code is released under:

Apache License

If you think the Android project crabox 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 com.costular.crabox;
/*from w  w  w  . j  av  a 2  s  . c  om*/
import com.badlogic.gdx.Application;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.costular.crabox.screens.GameScreen;
import com.costular.crabox.screens.MenuScreen;
import com.costular.crabox.util.AssetManager;
import com.costular.crabox.util.AudioManager;
import com.costular.crabox.util.FacebookRequest;
import com.costular.crabox.util.NotificationRequest;
import com.costular.crabox.util.Preferences;

public class Cbx {

  private static Preferences prefs;
  private static AssetManager assets;
  private static AudioManager audio;
  private static MainClass main;
  private static GameController controller;
  
  public static Screen currentScreen;
  
  public static MenuScreen menu;
  public static GameScreen game;
  
  //Notification controller
  private static NotificationRequest notification;
  
  //APIS controllers
  private static FacebookRequest facebook;
  
  public static GameController getController() {
    return controller;
  }
  
  public static Preferences getPreferences() {
    return prefs;
  }
  
  public static AssetManager getResources() {
    return assets;
  }
  
  public static AudioManager getAudio() {
    return audio;
  }

  public static void setAudio(AudioManager audio) {
    Cbx.audio = audio;
  }

  public static void goToMenu() {
    setScreen(menu);
  }
  
  public static void goToGame() {
    setScreen(game);
  }
  
  public static void showAds() {
    MainClass.RequestHandler.showAds(true);
  }
  
  public static void hideAds() {
    MainClass.RequestHandler.showAds(false);
  }
  
  public static void setScreen(Screen scr) {
    main.setScreen(scr);
    currentScreen = scr;
    
    controller.screenChanged();
  }
  
  public static void postOnFacebook(String desc, String link, String imageUrl) {
    facebook.post(desc, link, imageUrl);
  }
  
  public static void showShortToast(String message) {
    notification.showShortToast(message);
  }
  
  public static void showLongToast(String message) {
    notification.showLongToast(message);
  }
  
  public static void initialize(MainClass clase) {
    Gdx.app.setLogLevel(Application.LOG_DEBUG);
    
    prefs = new Preferences();
    assets = new AssetManager();
    audio = new AudioManager();
    
    main = clase;
    
    controller = new GameController();
    
    //load screens
    menu = new MenuScreen();
    game = new GameScreen();
    
    setScreen(menu); // Cargamose el men?.
  }
  
  public static void setFacebook(FacebookRequest face) {
    facebook = face;
  }
  
  public static void setNotification(NotificationRequest noti) {
    notification = noti;
  }
}




Java Source Code List

com.costular.crabox.AddInterface.java
com.costular.crabox.Cbx.java
com.costular.crabox.Controller.java
com.costular.crabox.GameController.java
com.costular.crabox.GameState.java
com.costular.crabox.MainClass.java
com.costular.crabox.actors.Box.java
com.costular.crabox.actors.ContactBodies.java
com.costular.crabox.actors.DefaultBox.java
com.costular.crabox.actors.DefaultTriangle.java
com.costular.crabox.actors.Player.java
com.costular.crabox.actors.Score.java
com.costular.crabox.actors.ToggleButton.java
com.costular.crabox.android.AndroidLauncher.java
com.costular.crabox.android.Facebook.java
com.costular.crabox.android.Notification.java
com.costular.crabox.android.RequestAd.java
com.costular.crabox.screens.GameScreen.java
com.costular.crabox.screens.HUD.java
com.costular.crabox.screens.MenuScreen.java
com.costular.crabox.util.AssetManager.java
com.costular.crabox.util.AudioManager.java
com.costular.crabox.util.Box2DUtils.java
com.costular.crabox.util.FacebookRequest.java
com.costular.crabox.util.GeometryUtils.java
com.costular.crabox.util.NotificationRequest.java
com.costular.crabox.util.Preferences.java
com.costular.crabox.util.StageGenerator.java
com.costular.crabox.util.Utils.java