Back to project page SnowLand.
The source code is released under:
GNU General Public License
If you think the Android project SnowLand listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.walrus.game; //from ww w .j av a 2s.co m import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import android.content.Context; import android.util.Log; import com.walrus.iceslider.R; import com.walrus.framework.Screen; import com.walrus.framework.implementation.AndroidGame; public class GameBoot extends AndroidGame { public static String map; boolean firstTimeCreate = true; @Override public Screen getInitScreen() { if (firstTimeCreate) { //Assets.load(this); firstTimeCreate = false; } InputStream is = getResources().openRawResource(R.raw.map1); map = convertStreamToString(is); return new SplashLoadingScreen(this); } @Override public void onBackPressed() { getCurrentScreen().backButton(); } private static String convertStreamToString(InputStream is) { BufferedReader reader = new BufferedReader(new InputStreamReader(is)); StringBuilder sb = new StringBuilder(); String line = null; try { while ((line = reader.readLine()) != null) { sb.append((line + "\n")); } } catch (IOException e) { Log.w("LOG", e.getMessage()); } finally { try { is.close(); } catch (IOException e) { Log.w("LOG", e.getMessage()); } } return sb.toString(); } @Override public void onResume() { super.onResume(); //Assets.theme.play(); } @Override public void onPause() { super.onPause(); //Assets.theme.pause(); } }