Changeset 04a9a00 in galcon-client for src/com/example/helloandroid/GameView.java


Ignore:
Timestamp:
Jun 14, 2010, 1:07:33 AM (14 years ago)
Author:
dportnoy <devnull@…>
Branches:
master
Children:
9d030cb
Parents:
647a312
Message:

Framerate is now set to 20 fps and planets spawn ships at different rates based on their size. However, fleets now don't leave a planet they're going around at the proper time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/com/example/helloandroid/GameView.java

    r647a312 r04a9a00  
    125125        public void run() {
    126126            while (mRun) {
    127                 //Log.i("Gencon", "run called");
    128                
    129127                Canvas c = null;
    130128                try {
    131129                    c = mSurfaceHolder.lockCanvas(null);
    132                     synchronized (mSurfaceHolder) {
    133                         //Log.i("Gencon", "about to call stuff: mode is "+mMode);
    134                        
    135                         if (mMode == STATE_RUNNING) updatePhysics();
     130                    synchronized(mSurfaceHolder) {
     131                        if(mMode == STATE_RUNNING)
     132                                updatePhysics();
    136133                        doDraw(c);
    137134                    }
     
    351348         */
    352349        private void updatePhysics() {
    353                 //Log.i("Gencon", "updatePhysics called");
    354                
    355350            long now = System.currentTimeMillis();
    356351
     
    359354            // by 100ms or whatever.
    360355            if (mLastTime > now) return;
    361 
     356           
    362357            synchronized(planetsLock) {
    363358                for(Planet p : planets) {
     
    378373            }
    379374
    380             mLastTime = now;
     375            mLastTime = now+50;
    381376        }
    382377    }
Note: See TracChangeset for help on using the changeset viewer.