Android Open Source - RockFall-Android Main Game






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   w  ww .  j  a  va  2s .  c  om*/
import android.app.*;
import android.os.Bundle;
import android.util.Log;
import android.view.*;
import android.content.*;
import android.content.pm.ActivityInfo;

import eu.raffprta.rockfall.core.entity.Protagonist;

public class MainGame extends Activity {

    private GameCanvas game;
    private MenuCanvas menu;

    @Override
    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(menu);
    }

    public void switchToGame(){
        this.finish();
        Intent i = new Intent(game.getContext(), GameIntent.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