Index: src/com/example/helloandroid/GameView.java
===================================================================
--- src/com/example/helloandroid/GameView.java	(revision b6a9b5f04771a141224e9fb6a56ffe9b8099efb9)
+++ src/com/example/helloandroid/GameView.java	(revision 5053d901dba69d758c57cb533a762e700f66a613)
@@ -17,4 +17,5 @@
 import android.util.Log;
 import android.view.KeyEvent;
+import android.view.MotionEvent;
 import android.view.SurfaceHolder;
 import android.view.SurfaceView;
@@ -170,5 +171,8 @@
         private double mY;
         
-        private ArrayList<Planet> planets;
+        public Object planetsLock;
+        
+        public ArrayList<Planet> planets;
+        public Planet planetSelected;
 
         public DrawingThread(SurfaceHolder surfaceHolder, Context context,
@@ -215,6 +219,9 @@
             mHeading = 0;
             mEngineFiring = true;
+        
+            planetsLock = new Object();
             
             planets = new ArrayList<Planet>();
+            planetSelected = null;
         }
 
@@ -463,5 +470,5 @@
             }
         }
-
+        
         /* Callback invoked when the surface dimensions change. */
         public void setSurfaceSize(int width, int height) {
@@ -475,17 +482,19 @@
                 Random rand = new Random();
 
-                for(int x=0; x<15; x++) {
-                	Planet p = new Planet(rand.nextInt(45)+5, rand.nextInt(mCanvasWidth), rand.nextInt(mCanvasHeight));
-                	
-                	if(Planet.collisionDetected(p, planets)) {
-                		x--;
-                	}else if(p.getX()-p.getRadius() < 0 || mCanvasWidth<=p.getX()+p.getRadius() ||
-                			 p.getY()-p.getRadius() < 0 || mCanvasHeight<=p.getY()+p.getRadius()) {
-                		x--;
-                	}else {
-                		p.setNumShips(rand.nextInt(150));
-                		p.setFaction(rand.nextInt(5));
-                		planets.add(p);
-                	}
+                synchronized(planetsLock) {
+	                for(int x=0; x<15; x++) {
+	                	Planet p = new Planet(rand.nextInt(45)+5, rand.nextInt(mCanvasWidth), rand.nextInt(mCanvasHeight));
+	                	
+	                	if(Planet.collisionDetected(p, planets)) {
+	                		x--;
+	                	}else if(p.getX()-p.getRadius() < 0 || mCanvasWidth<=p.getX()+p.getRadius() ||
+	                			 p.getY()-p.getRadius() < 0 || mCanvasHeight<=p.getY()+p.getRadius()) {
+	                		x--;
+	                	}else {
+	                		p.setNumShips(rand.nextInt(150));
+	                		p.setFaction(rand.nextInt(5));
+	                		planets.add(p);
+	                	}
+	                }
                 }
                 	
@@ -569,14 +578,15 @@
          */
         private void doDraw(Canvas canvas) {
-            // Draw the background image. Operations on the Canvas accumulate
-            // so this is like clearing the screen.
+        	canvas.drawBitmap(mBackgroundImage, 0, 0, null);
+        	synchronized(planetsLock) {
+        		for(Planet p : planets) {
+            		p.draw(canvas, mLinePaint, mTextPaint);
+            	}
+        	}
             
-        	//Log.i("Gencon", "doDraw called");
+        	if(planetSelected != null) {
+    			planetSelected.drawSelectionCircle(canvas);
+    		}
         	
-        	canvas.drawBitmap(mBackgroundImage, 0, 0, null);
-            for(Planet p : planets) {
-            	p.draw(canvas, mLinePaint, mTextPaint);
-            }
-            
             int yTop = mCanvasHeight - ((int) mY + mLanderHeight / 2);
             int xLeft = (int) mX - mLanderWidth / 2;
@@ -585,14 +595,8 @@
             canvas.save();
             canvas.rotate((float)mHeading, (float)mX, mCanvasHeight - (float)mY);
-            if (mMode == STATE_LOSE) {
-                //mCrashedImage.setBounds(xLeft, yTop, xLeft + mLanderWidth, yTop + mLanderHeight);
-                //mCrashedImage.draw(canvas);
-            } else if (mEngineFiring) {
-                //mFiringImage.setBounds(xLeft, yTop, xLeft + mLanderWidth, yTop + mLanderHeight);
-                //mFiringImage.draw(canvas);
-            } else {
-                mLanderImage.setBounds(xLeft, yTop, xLeft + mLanderWidth, yTop + mLanderHeight);
-                mLanderImage.draw(canvas);
-            }
+            
+            mLanderImage.setBounds(xLeft, yTop, xLeft + mLanderWidth, yTop + mLanderHeight);
+            mLanderImage.draw(canvas);
+                
             canvas.restore();
         }
@@ -655,6 +659,8 @@
             }
 
-            for(Planet p : planets) {
-            	p.update();
+            synchronized(planetsLock) {
+            	for(Planet p : planets) {
+            		p.update();
+            	}
             }
             
@@ -740,4 +746,25 @@
     }
 
+    @Override public boolean onTouchEvent(MotionEvent event) {
+    	Log.i("Gencon", "Detected touch event");
+    	
+    	synchronized(thread.planetsLock) {
+    		if(thread.planetSelected != null) {
+    			thread.planetSelected.unselect();
+    			thread.planetSelected = null;
+    		}
+    		
+	        for(Planet p : thread.planets) {
+	        	if(p.contains((int)event.getX(), (int)event.getY())) {
+	        		p.select();
+	        		thread.planetSelected = p;
+	        		break;
+	        	}
+	        }
+    	}
+        
+        return true;
+    }
+    
     /**
      * Fetches the animation thread corresponding to this LunarView.
