Пример #1
0
		public MessageHandler (TextView timerView, Button retryButton, TextView textView, Scoreboard scores)
		{
			timer_view = timerView;
			retry_button = retryButton;
			text_view = textView;
			this.scores = scores;
		}
Пример #2
0
		public JetBoyView (Context context, IAttributeSet attrs)
			: base (context, attrs)
		{
			scores = new Scoreboard ();

			// make sure we get key events
			Focusable = true; 
		}
Пример #3
0
        public JetBoyView(Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
            scores = new Scoreboard();

            // make sure we get key events
            Focusable = true;
        }
Пример #4
0
        public JetBoyThread(ISurfaceHolder surfaceHolder, Context context, Scoreboard scores, Handler handler)
        {
            this.scores = scores;

            mSurfaceHolder = surfaceHolder;
            mHandler = handler;
            mContext = context;
            mRes = context.Resources;

            for (int x = 0; x < muteMask.Length; x++)
                muteMask[x] = new bool[32];

            // JET info: this are the mute arrays associated with the music beds in the
            // JET info: JET file
            for (int ii = 0; ii < 8; ii++)
                for (int xx = 0; xx < 32; xx++)
                    muteMask[ii][xx] = true;

            muteMask[0][2] = false;
            muteMask[0][3] = false;
            muteMask[0][4] = false;
            muteMask[0][5] = false;

            muteMask[1][2] = false;
            muteMask[1][3] = false;
            muteMask[1][4] = false;
            muteMask[1][5] = false;
            muteMask[1][8] = false;
            muteMask[1][9] = false;

            muteMask[2][2] = false;
            muteMask[2][3] = false;
            muteMask[2][6] = false;
            muteMask[2][7] = false;
            muteMask[2][8] = false;
            muteMask[2][9] = false;

            muteMask[3][2] = false;
            muteMask[3][3] = false;
            muteMask[3][6] = false;
            muteMask[3][11] = false;
            muteMask[3][12] = false;

            muteMask[4][2] = false;
            muteMask[4][3] = false;
            muteMask[4][10] = false;
            muteMask[4][11] = false;
            muteMask[4][12] = false;
            muteMask[4][13] = false;

            muteMask[5][2] = false;
            muteMask[5][3] = false;
            muteMask[5][10] = false;
            muteMask[5][12] = false;
            muteMask[5][15] = false;
            muteMask[5][17] = false;

            muteMask[6][2] = false;
            muteMask[6][3] = false;
            muteMask[6][14] = false;
            muteMask[6][15] = false;
            muteMask[6][16] = false;
            muteMask[6][17] = false;

            muteMask[7][2] = false;
            muteMask[7][3] = false;
            muteMask[7][6] = false;
            muteMask[7][14] = false;
            muteMask[7][15] = false;
            muteMask[7][16] = false;
            muteMask[7][17] = false;
            muteMask[7][18] = false;

            // Set all tracks to play
            for (int xx = 0; xx < 32; xx++)
                muteMask[8][xx] = false;

            // Always set state to start, ensure we come in from
            // front door if app gets tucked into background
            mState = GameState.Start;

            SetInitialGameState ();

            // Load background image as a Bitmap instead of a Drawable b/c
            // we don't need to transform it and it's faster to draw this way
            mTitleBG = BitmapFactory.DecodeResource (mRes, Resource.Drawable.title_hori);

            // Two background since we want them moving at different speeds
            mBackgroundImageFar = BitmapFactory.DecodeResource (mRes, Resource.Drawable.background_a);
            mBackgroundImageNear = BitmapFactory.DecodeResource (mRes, Resource.Drawable.background_b);

            mLaserShot = BitmapFactory.DecodeResource (mRes, Resource.Drawable.laser);

            mShipFlying[0] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.ship2_1);
            mShipFlying[1] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.ship2_2);
            mShipFlying[2] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.ship2_3);
            mShipFlying[3] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.ship2_4);

            mBeam[0] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.intbeam_1);
            mBeam[1] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.intbeam_2);
            mBeam[2] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.intbeam_3);
            mBeam[3] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.intbeam_4);

            mTimerShell = BitmapFactory.DecodeResource (mRes, Resource.Drawable.int_timer);

            // I wanted them to rotate in a certain way
            // so I loaded them backwards from the way created.
            mAsteroids[11] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid01);
            mAsteroids[10] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid02);
            mAsteroids[9] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid03);
            mAsteroids[8] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid04);
            mAsteroids[7] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid05);
            mAsteroids[6] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid06);
            mAsteroids[5] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid07);
            mAsteroids[4] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid08);
            mAsteroids[3] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid09);
            mAsteroids[2] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid10);
            mAsteroids[1] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid11);
            mAsteroids[0] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid12);

            mExplosions[0] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid_explode1);
            mExplosions[1] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid_explode2);
            mExplosions[2] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid_explode3);
            mExplosions[3] = BitmapFactory.DecodeResource (mRes, Resource.Drawable.asteroid_explode4);
        }
Пример #5
0
        public JetBoyThread(ISurfaceHolder surfaceHolder, Context context, Scoreboard scores, Handler handler)
        {
            this.scores = scores;

            mSurfaceHolder = surfaceHolder;
            mHandler       = handler;
            mContext       = context;
            mRes           = context.Resources;

            for (int x = 0; x < muteMask.Length; x++)
            {
                muteMask[x] = new bool[32];
            }

            // JET info: this are the mute arrays associated with the music beds in the
            // JET info: JET file
            for (int ii = 0; ii < 8; ii++)
            {
                for (int xx = 0; xx < 32; xx++)
                {
                    muteMask[ii][xx] = true;
                }
            }

            muteMask[0][2] = false;
            muteMask[0][3] = false;
            muteMask[0][4] = false;
            muteMask[0][5] = false;

            muteMask[1][2] = false;
            muteMask[1][3] = false;
            muteMask[1][4] = false;
            muteMask[1][5] = false;
            muteMask[1][8] = false;
            muteMask[1][9] = false;

            muteMask[2][2] = false;
            muteMask[2][3] = false;
            muteMask[2][6] = false;
            muteMask[2][7] = false;
            muteMask[2][8] = false;
            muteMask[2][9] = false;

            muteMask[3][2]  = false;
            muteMask[3][3]  = false;
            muteMask[3][6]  = false;
            muteMask[3][11] = false;
            muteMask[3][12] = false;

            muteMask[4][2]  = false;
            muteMask[4][3]  = false;
            muteMask[4][10] = false;
            muteMask[4][11] = false;
            muteMask[4][12] = false;
            muteMask[4][13] = false;

            muteMask[5][2]  = false;
            muteMask[5][3]  = false;
            muteMask[5][10] = false;
            muteMask[5][12] = false;
            muteMask[5][15] = false;
            muteMask[5][17] = false;

            muteMask[6][2]  = false;
            muteMask[6][3]  = false;
            muteMask[6][14] = false;
            muteMask[6][15] = false;
            muteMask[6][16] = false;
            muteMask[6][17] = false;

            muteMask[7][2]  = false;
            muteMask[7][3]  = false;
            muteMask[7][6]  = false;
            muteMask[7][14] = false;
            muteMask[7][15] = false;
            muteMask[7][16] = false;
            muteMask[7][17] = false;
            muteMask[7][18] = false;

            // Set all tracks to play
            for (int xx = 0; xx < 32; xx++)
            {
                muteMask[8][xx] = false;
            }

            // Always set state to start, ensure we come in from
            // front door if app gets tucked into background
            mState = GameState.Start;

            SetInitialGameState();

            // Load background image as a Bitmap instead of a Drawable b/c
            // we don't need to transform it and it's faster to draw this way
            mTitleBG = BitmapFactory.DecodeResource(mRes, Resource.Drawable.title_hori);

            // Two background since we want them moving at different speeds
            mBackgroundImageFar  = BitmapFactory.DecodeResource(mRes, Resource.Drawable.background_a);
            mBackgroundImageNear = BitmapFactory.DecodeResource(mRes, Resource.Drawable.background_b);

            mLaserShot = BitmapFactory.DecodeResource(mRes, Resource.Drawable.laser);

            mShipFlying[0] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.ship2_1);
            mShipFlying[1] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.ship2_2);
            mShipFlying[2] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.ship2_3);
            mShipFlying[3] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.ship2_4);

            mBeam[0] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.intbeam_1);
            mBeam[1] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.intbeam_2);
            mBeam[2] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.intbeam_3);
            mBeam[3] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.intbeam_4);

            mTimerShell = BitmapFactory.DecodeResource(mRes, Resource.Drawable.int_timer);

            // I wanted them to rotate in a certain way
            // so I loaded them backwards from the way created.
            mAsteroids[11] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid01);
            mAsteroids[10] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid02);
            mAsteroids[9]  = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid03);
            mAsteroids[8]  = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid04);
            mAsteroids[7]  = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid05);
            mAsteroids[6]  = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid06);
            mAsteroids[5]  = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid07);
            mAsteroids[4]  = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid08);
            mAsteroids[3]  = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid09);
            mAsteroids[2]  = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid10);
            mAsteroids[1]  = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid11);
            mAsteroids[0]  = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid12);

            mExplosions[0] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid_explode1);
            mExplosions[1] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid_explode2);
            mExplosions[2] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid_explode3);
            mExplosions[3] = BitmapFactory.DecodeResource(mRes, Resource.Drawable.asteroid_explode4);
        }
 public MessageHandler(TextView timerView, Button retryButton, TextView textView, Scoreboard scores)
 {
     timer_view   = timerView;
     retry_button = retryButton;
     text_view    = textView;
     this.scores  = scores;
 }