14.06.2011

GameThreadConstructors

posted by Karsten

public GameThread(GameView gameView) { mGameView = gameView; mSurfaceHolder = gameView.getHolder(); mHandler = gameView.getmHandler(); mContext = gameView.getContext(); mBackgroundImage = BitmapFactory.decodeResource (gameView.getContext().getResources(), R.drawable.background); mBall = BitmapFactory.decodeResource (gameView.getContext().getResources(), R.drawable.yellow_ball); } public GameThread(GameView gameView, GameThread oldThread) { mGameView = gameView; mSurfaceHolder = gameView.getHolder(); mHandler = gameView.getmHandler(); mContext = gameView.getContext(); //Transfer the old values mMode = oldThread.mMode; mRun = oldThread.mRun; mCanvasWidth = oldThread.mCanvasWidth; mCanvasHeight = oldThread.mCanvasHeight; mLastTime = oldThread.mLastTime; mBackgroundImage = oldThread.mBackgroundImage; score = oldThread.score; mBall = oldThread.mBall; mBallX = oldThread.mBallX; mBallY = oldThread.mBallY; mBallDX = oldThread.mBallDX; mBallDY = oldThread.mBallDY; }

Share

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment