Android Open Source - Open-Android-Game Main Activity






From Project

Back to project page Open-Android-Game.

License

The source code is released under:

GNU General Public License

If you think the Android project Open-Android-Game 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

/* MainActivity.java - The main class that extends activity.
*//from w  w w.  java2  s  .  c o  m
* Copyright  2011 Open-Android-Game Group
* Please see the file COPYING in this
* distribution for license terms.
*/

package com.kylepaulsen.openAndroidGame;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;

public class MainActivity extends Activity {
    
GraphicsView gameView;
/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        //Get rid of the application title bar.
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        //Force application full screen.
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        
        Constants.WINDOW_HEIGHT = getWindowManager().getDefaultDisplay().getHeight();
        Constants.WINDOW_WIDTH = getWindowManager().getDefaultDisplay().getWidth();
        
        //Kyle's android screen is 480x800
        Log.d("Main", "screen dimentions: "+Constants.WINDOW_WIDTH+", "+Constants.WINDOW_HEIGHT);
        
        gameView = new GraphicsView(this);
        
        //Set the graphics view as the main content view.
        //Note that R.layout.main is now no longer used..
      
        setContentView(gameView);
        
    }
}




Java Source Code List

com.kylepaulsen.openAndroidGame.BaseTiles.java
com.kylepaulsen.openAndroidGame.Biome.java
com.kylepaulsen.openAndroidGame.Constants.java
com.kylepaulsen.openAndroidGame.CopyOfPlayer.java
com.kylepaulsen.openAndroidGame.GameProgram.java
com.kylepaulsen.openAndroidGame.GraphicsView.java
com.kylepaulsen.openAndroidGame.Home.java
com.kylepaulsen.openAndroidGame.LocationTask.java
com.kylepaulsen.openAndroidGame.MainActivity.java
com.kylepaulsen.openAndroidGame.Monster.java
com.kylepaulsen.openAndroidGame.PlayerAnimated.java
com.kylepaulsen.openAndroidGame.Player.java
com.kylepaulsen.openAndroidGame.Tile.java
com.kylepaulsen.openAndroidGame.WorldEnt.java
com.kylepaulsen.openAndroidGame.World.java