Changeset 3a0d468 in galcon-client for src/com/example/helloandroid/Game.java
- Timestamp:
- Jun 20, 2010, 6:29:03 PM (15 years ago)
- Branches:
- master
- Children:
- a4f5200, b87af8a
- Parents:
- 9d030cb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/com/example/helloandroid/Game.java
r9d030cb r3a0d468 11 11 12 12 public class Game extends Activity { 13 private static final int MENU_EASY = 1; 14 15 private static final int MENU_HARD = 2; 16 17 private static final int MENU_MEDIUM = 3; 18 19 private static final int MENU_PAUSE = 4; 20 21 private static final int MENU_RESUME = 5; 22 23 private static final int MENU_START = 6; 24 25 private static final int MENU_STOP = 7; 13 private static final int MENU_PAUSE = 1; 14 private static final int MENU_RESUME = 2; 15 private static final int MENU_START = 3; 16 private static final int MENU_STOP = 4; 17 private static final int MENU_CONNECT = 5; 26 18 27 19 /** A handle to the thread that's actually running the animation. */ 28 p rivateDrawingThread mThread;20 public DrawingThread mThread; 29 21 30 22 /** A handle to the View in which the game is running. */ 31 23 private GameView mGameView; 32 24 25 private ClientThread client; 26 33 27 /** 34 28 * Invoked during init to give the Activity a chance to set up its Menu. … … 45 39 menu.add(0, MENU_PAUSE, 0, R.string.menu_pause); 46 40 menu.add(0, MENU_RESUME, 0, R.string.menu_resume); 47 menu.add(0, MENU_EASY, 0, R.string.menu_easy); 48 menu.add(0, MENU_MEDIUM, 0, R.string.menu_medium); 49 menu.add(0, MENU_HARD, 0, R.string.menu_hard); 41 menu.add(0, MENU_CONNECT, 0, R.string.menu_connect); 50 42 51 43 return true; … … 66 58 return true; 67 59 case MENU_STOP: 68 mThread.setState(DrawingThread.STATE_LOSE, 69 getText(R.string.message_stopped)); 60 mThread.setState(DrawingThread.STATE_LOSE, getText(R.string.message_stopped)); 70 61 return true; 71 62 case MENU_PAUSE: … … 75 66 mThread.unpause(); 76 67 return true; 68 case MENU_CONNECT: 69 mThread.connectionStarted = true; 70 client = new ClientThread("192.168.1.6", 1337, this); 71 client.start(); 72 mThread.doStart(); 73 return true; 77 74 } 78 75
Note:
See TracChangeset
for help on using the changeset viewer.