Android Open Source - RockFall-Android Game Intent






From Project

Back to project page RockFall-Android.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project RockFall-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 eu.raffprta.rockfall.app;
//from  www.  j  a  v a  2  s.c o  m
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;


public class GameIntent extends Activity {

    private GameCanvas game;
    private MenuCanvas menu;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Context ctx = getApplicationContext();
        // Remove title bar, as it is of no use in the game.
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        // Set mode to fullscreen
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        // Set game and menu canvas
        game = new GameCanvas(ctx, this, new GameScreen(ctx.getResources().getDisplayMetrics().widthPixels, ctx.getResources().getDisplayMetrics().heightPixels));
        menu = new MenuCanvas(ctx, this, new GameScreen(ctx.getResources().getDisplayMetrics().widthPixels, ctx.getResources().getDisplayMetrics().heightPixels));
        setContentView(game);


    }

    public void switchToMenu(){
        this.finish();
        Intent i = new Intent(menu.getContext(), MainGame.class);
        startActivity(i);
    }

}




Java Source Code List

eu.raffprta.rockfall.app.GameCanvas.java
eu.raffprta.rockfall.app.GameIntent.java
eu.raffprta.rockfall.app.GameScreen.java
eu.raffprta.rockfall.app.MainGame.java
eu.raffprta.rockfall.app.MenuCanvas.java
eu.raffprta.rockfall.app.SpriteContainer.java
eu.raffprta.rockfall.app.StopWatch.java
eu.raffprta.rockfall.app.TouchHandler.java
eu.raffprta.rockfall.core.entity.AbstractEntity.java
eu.raffprta.rockfall.core.entity.EntityFactory.java
eu.raffprta.rockfall.core.entity.Entity.java
eu.raffprta.rockfall.core.entity.FallableType.java
eu.raffprta.rockfall.core.entity.Fallable.java
eu.raffprta.rockfall.core.entity.Powerup.java
eu.raffprta.rockfall.core.entity.Protagonist.java
eu.raffprta.rockfall.core.entity.Rock.java
eu.raffprta.rockfall.core.sprite.SpriteFactory.java
eu.raffprta.rockfall.core.sprite.SpriteSheet.java
eu.raffprta.rockfall.core.sprite.Sprite.java