Advertisement
Conderoga

Untitled

Jan 2nd, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.78 KB | None | 0 0
  1. package com.DJR.MazeMaker;
  2.  
  3.  
  4. import android.graphics.Point;
  5.  
  6. import java.util.ArrayList;
  7. import java.util.Arrays;
  8. import java.util.Iterator;
  9. import java.util.LinkedList;
  10.  
  11. import android.app.Activity;
  12. import android.app.AlertDialog;
  13. import android.content.DialogInterface;
  14. import android.content.pm.ActivityInfo;
  15. import android.graphics.Bitmap;
  16. import android.graphics.Bitmap.Config;
  17. import android.graphics.Canvas;
  18. import android.graphics.Color;
  19. import android.graphics.Paint;
  20. import android.graphics.Rect;
  21. import android.graphics.RectF;
  22. import android.hardware.Sensor;
  23. import android.hardware.SensorEvent;
  24. import android.hardware.SensorEventListener;
  25. import android.hardware.SensorManager;
  26. import android.os.Bundle;
  27. import android.util.Log;
  28. import android.view.MotionEvent;
  29. import android.view.View;
  30. import android.view.View.OnClickListener;
  31. import android.view.View.OnTouchListener;
  32.  
  33. public class MazeMaker extends Activity implements OnTouchListener
  34. {
  35.  
  36. //actual Maze object
  37. private Maze maze;
  38. //holds maze, so only have to calculate drawing of image once, and can then redraw maze from image
  39. private Bitmap mazeBitmap;
  40. private Canvas mazeCanvas;
  41. private MazeView mazeView;
  42. //the length of each side of a cell (in pixels)
  43. private float horizWallLength, vertWallLength;
  44. //controls animation
  45. private ThreadClass animation_;
  46. //in cells, not pixels!!
  47. private int mazeWidth, mazeHeight;
  48. //start is 0, most recent point is the last
  49. private ArrayList<Point> path;
  50. //stores points for the fancy path
  51. private Point pathPoint;
  52. private float thickness = -1;
  53. //volatile b/c modified in UI thread but used in main thread, want to make sure value is consistent
  54. private volatile int fingerX, fingerY;
  55. private volatile boolean fingerOn;
  56. private int startX, startY, endX,endY,minLength;
  57.  
  58.  
  59. @Override
  60. public void onCreate(Bundle savedInstanceState) {
  61. super.onCreate(savedInstanceState);
  62. setContentView(R.layout.main);
  63. this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
  64. }
  65.  
  66. @Override
  67. public void onStart()
  68. {
  69. super.onStart();
  70. AlertDialog.Builder dialog = new AlertDialog.Builder(this);
  71. dialog.setMessage("Welcome to Maze Maker, where YOU can solve randomly generated mazes!");
  72. dialog.setPositiveButton("OK", new DialogInterface.OnClickListener()
  73. {
  74. @Override
  75. public void onClick(DialogInterface dialog, int which)
  76. {
  77. dialog.dismiss();
  78. startGame();
  79. }
  80. });
  81. dialog.show();
  82. mazeView = (MazeView)findViewById(R.id.maze_view);
  83. if(mazeView == null){
  84. Log.e("Maze View","Could not find");
  85. }
  86. else{
  87. mazeView.setOnTouchListener(this);
  88. }
  89.  
  90. }
  91.  
  92. /**
  93. * Draws the maze image to the canvas and the current path over the canvas
  94. * @param canvas:the canvas to draw on
  95. */
  96. protected void drawGameContents(Canvas canvas)
  97. {
  98. if(mazeBitmap == null){
  99. resetMaze();
  100. }
  101. Paint p = new Paint();
  102. Bitmap tempBitmap = Bitmap.createBitmap(mazeView.getWidth(),mazeView.getHeight(),Bitmap.Config.ARGB_8888);
  103. Canvas tempCanvas = new Canvas(tempBitmap);
  104. tempCanvas.drawBitmap(mazeBitmap,new Rect(0,0,mazeBitmap.getWidth(),mazeBitmap.getHeight()), new RectF(0,0,mazeView.getWidth(),mazeView.getHeight()),p);
  105. //draw path and finger
  106. int drawColor = Color.RED;
  107. p.setColor(drawColor);
  108. float draw1X, draw2X, draw1Y, draw2Y;
  109.  
  110. thickness = Math.min(horizWallLength,vertWallLength)/3;
  111. p.setStrokeWidth(thickness);
  112. p.setColor(Color.RED);
  113. /*if(pathPoints!=null)
  114. for(int i = 0; i < pathPoints.size()-1; i++){
  115. tempCanvas.drawLine(pathPoints.get(i).x,pathPoints.get(i).y,
  116. pathPoints.get(i+1).x,pathPoints.get(i+1).y,p);
  117. tempCanvas.drawOval(new RectF(pathPoints.get(i).x-(thickness/2), pathPoints.get(i).y-(thickness/2),
  118. pathPoints.get(i).x+(thickness/2), pathPoints.get(i).y+(thickness/2)), p);
  119. if(i == pathPoints.size()-1){
  120. tempCanvas.drawOval(new RectF(pathPoints.get(i+1).x-(thickness/2), pathPoints.get(i+1).y-(thickness/2),
  121. pathPoints.get(i+1).x+(thickness/2), pathPoints.get(i+1).y+(thickness/2)), p);
  122. }
  123. }*/
  124.  
  125. if(path!=null && path.size()>1){
  126. //Log.e("Drawing path",""+path.size());
  127. //starts from end b/c used to try to do color gradient as path got older, but too much work/didn't work
  128. drawColor = Color.RED;
  129. p.setColor(drawColor);
  130. int i = path.size()-2; // < -----------------------------------------------------------------------------------------------------------------------SWITCH THIS BETWEEN 1 AND 2
  131. if(i>=0){
  132. Point cur = path.get(i);
  133. draw2X = (cur.x +0.5f)*horizWallLength;
  134. draw2Y = (cur.y +0.5f)*vertWallLength;
  135. thickness = Math.min(horizWallLength,vertWallLength)/3;
  136. p.setStrokeWidth(thickness);
  137. tempCanvas.drawLine(draw2X,draw2Y,pathPoint.x,pathPoint.y,p); //draws to current position of finger
  138. tempCanvas.drawOval(new RectF(pathPoint.x-(thickness/2), pathPoint.y-(thickness/2), //circle on joints in path
  139. pathPoint.x+(thickness/2),pathPoint.y+(thickness/2)), p);
  140. i--;
  141. while(i>=0){
  142. cur = path.get(i);
  143. draw1X = draw2X;
  144. draw1Y = draw2Y;
  145. draw2X = (cur.x +0.5f)*horizWallLength;
  146. draw2Y = (cur.y +0.5f)*vertWallLength;
  147. //drawColor -= 0x080000; Not entirely sure what this was trying to accomplish...
  148. // if(drawColor<0x800000){
  149. // drawColor = 0x800000;//after a while, all same color
  150. // }
  151. p.setColor(drawColor);
  152. //tempCanvas.drawRect(draw1X-.2f*horizWallLength,draw1Y-.2f*vertWallLength,draw2X+.2f*horizWallLength,draw2Y+.2f*vertWallLength, p);
  153. tempCanvas.drawOval(new RectF(draw1X-(thickness/2), draw1Y-(thickness/2), //circle on joints in path
  154. draw1X+(thickness/2),draw1Y+(thickness/2)), p);
  155. tempCanvas.drawLine(draw1X,draw1Y,draw2X,draw2Y,p);
  156. i--;
  157. }
  158. }
  159.  
  160. }
  161. /*p.setStrokeWidth(6);
  162. if(fingerOn && path!=null && path.size()>0){
  163. //Log.e("Drawing","Finger");
  164. Point last = path.get(path.size()-1);
  165. draw1X = (last.x +0.5f)*horizWallLength;
  166. draw1Y = (last.y +0.5f)*vertWallLength;
  167. draw2X = (fingerX +0.5f)*horizWallLength;
  168. draw2Y = (fingerY +0.5f)*vertWallLength;
  169. p.setColor(0x00FF00);
  170. tempCanvas.drawLine(draw1X,draw1Y,draw2X,draw2Y,p);
  171. }*/
  172. if(fingerOn){
  173. p.setColor(Color.YELLOW);
  174. //tempCanvas.drawCircle(fingerX,fingerY,Math.min(horizWallLength,vertWallLength)/2,p);
  175. //tempCanvas.drawCircle(path.getFirst().x, path.getFirst().y, Math.min(horizWallLength,vertWallLength)/3, p);
  176. }
  177. //copy drawing from temp bitmap over to final bitmap
  178. p.setColor(Color.WHITE);//not sure why this prevents whole screen from being black, but it does...
  179. canvas.drawBitmap(tempBitmap,new Rect(0,0,mazeView.getWidth(),mazeView.getHeight()), new RectF(0,0,mazeView.getWidth(),mazeView.getHeight()),p);//allows scaling of final thing to fit screen while having to do no scaling calculations throughout logic
  180. }
  181.  
  182. private void resetMaze(){
  183. int r, c;
  184. //prompt user for menu (probably small, medium, large, maybe XL choice from a list) TODO - use AlertDialog
  185. r = 5;
  186. c = 10;
  187. maze = new Maze(r,c);
  188. maze.generateMaze();
  189. Log.e("copy",maze.printMaze());
  190. horizWallLength = (1.0f*mazeView.getWidth())/c;
  191. vertWallLength = (1.0f*mazeView.getHeight())/r;
  192. if(path!=null){
  193. path.clear();
  194. }
  195. else{
  196. path = new ArrayList<Point>();
  197. }
  198. mazeBitmap = Bitmap.createBitmap(mazeView.getWidth(),mazeView.getHeight(),Config.ARGB_8888);
  199. mazeCanvas = new Canvas(mazeBitmap);
  200. Log.e("Maze Bitmap created: ",mazeCanvas.getWidth()+"x"+mazeCanvas.getHeight());
  201. Paint p = new Paint();
  202. p.setStrokeWidth(3);
  203. mazeCanvas.drawColor(Color.WHITE);
  204.  
  205. int[] endsStuff = maze.getFurthestEnds();
  206. //gets furthest start and end points, as well as the distance between them
  207. startX = endsStuff[0];
  208. startY = endsStuff[1];
  209. endX = endsStuff[2];
  210. endY = endsStuff[3];
  211. minLength = endsStuff[4];
  212.  
  213. p.setColor(Color.GREEN);
  214. mazeCanvas.drawRect(startX*horizWallLength, startY*vertWallLength, (startX+1)*horizWallLength, (startY+1)*vertWallLength, p);
  215. p.setColor(Color.CYAN);
  216. mazeCanvas.drawRect(endX*horizWallLength, endY*vertWallLength, (endX+1)*horizWallLength, (endY+1)*vertWallLength, p);
  217. p.setColor(Color.BLACK);
  218. mazeCanvas.drawLine(0,0,mazeCanvas.getWidth(),0,p);
  219. mazeCanvas.drawLine(0,0,0,mazeCanvas.getHeight(),p);
  220. //top right corner of square being drawn
  221. float drawX, drawY;
  222. drawY = 0.0f;
  223. for(int r2 = 0; r2<r;r2++){
  224. drawX = 0;
  225. for(int c2 = 0; c2<c;c2++){
  226. if(maze.hasSouthWall(r2, c2)){
  227. mazeCanvas.drawLine(drawX,drawY+vertWallLength,drawX+horizWallLength,drawY+vertWallLength,p);
  228. //Log.e("("+r2+","+c2+")","has south wall, drawing from ("+(drawX/horizWallLength)+","+((drawY+vertWallLength)/vertWallLength)+") to ("+((drawX+horizWallLength)/horizWallLength)+","+((drawY+vertWallLength)/vertWallLength)+")");
  229. }
  230. if(maze.hasEastWall(r2,c2)){
  231. mazeCanvas.drawLine(drawX+horizWallLength, drawY, drawX+horizWallLength, drawY+vertWallLength, p);
  232. //Log.e("("+r2+","+c2+")","has east wall, drawing from ("+((drawX+horizWallLength)/horizWallLength)+","+(drawY/vertWallLength)+") to ("+((drawX+horizWallLength)/horizWallLength)+","+((drawY+vertWallLength)/vertWallLength)+")");
  233. }
  234. /*p.setColor(Color.RED);
  235. mazeCanvas.drawCircle(drawX,drawY,12,p);
  236. p.setColor(Color.BLACK);*/
  237. drawX+=horizWallLength;
  238. }
  239. drawY+=vertWallLength;
  240. }
  241. /*//make up bs path for testing
  242. path = new LinkedList<Point>();
  243. path.addFirst(new Point(0,0));
  244. path.addFirst(new Point(0,1));
  245. path.addFirst(new Point(1,1));
  246. path.addFirst(new Point(2,1));
  247. for(int i = 0; i<walls.length;i++){
  248. Log.e("Walls",Arrays.toString(walls[i]));
  249. }*/
  250. //need to do the wall checking testing
  251. //Log.e("Clear between (0,0) and (1,1)",""+noWallsBetween(new Point(0,0), new Point(1,1)));
  252. //Log.e("Clear between (0,0) and (1,0)",""+noWallsBetween(new Point(0,0), new Point(1,0)));
  253. //Log.e("Clear between (0,0) and (0,1)",""+noWallsBetween(new Point(0,0), new Point(0,1)));
  254. //Log.e("Clear between (1,1) and (4,1)",""+noWallsBetween(new Point(1,1), new Point(4,1)));
  255.  
  256. }
  257. private void handlePathPoint(int x, int y){
  258. Point p = new Point(x,y);
  259. if(checkPathPoint(p)){
  260. pathPoint = p;
  261. }
  262. }
  263. private boolean checkPathPoint(Point p){
  264. if(thickness == -1)
  265. return false;
  266. float remX = p.x%horizWallLength;
  267. float remY = p.y % vertWallLength;
  268. return remX>thickness/2 && remX < horizWallLength-(thickness/2) &&
  269. remY>thickness/2 && remY < vertWallLength-(thickness/2);
  270. }
  271. private boolean pointsEqual(Point p1, Point p2){
  272. return p1.x==p2.x && p1.y == p2.y;
  273. }
  274. /**
  275. * Starts the animation thread, which starts the game
  276. */
  277. public void startGame()
  278. {
  279. if(animation_==null)
  280. {
  281. animation_ = new ThreadClass(this);
  282. }
  283. animation_.start();
  284. if(mazeView == null){
  285. Log.e("Maze View","Retrying to set maze view");
  286. }
  287. if(mazeView == null){
  288. Log.e("Maze View","Retry failed");
  289. }
  290. else{
  291. Log.e("Maze View","Retry succesful");
  292. }
  293.  
  294. }
  295. /**
  296. * Stops the animation thread, which stops the game
  297. */
  298. public void stopGame()
  299. {
  300. if(animation_!=null)
  301. {
  302. animation_.stop();
  303. }
  304. animation_ = null;
  305. }
  306.  
  307. /*private void reset()
  308. {
  309. if(data_!=null)
  310. {
  311. data_.reset();
  312. }
  313. else
  314. {
  315. data_ = new GameData(this);
  316. }
  317. }*/
  318.  
  319.  
  320. @Override
  321. protected void onResume()
  322. {
  323. super.onResume();
  324. if(animation_!=null)
  325. {
  326. animation_.start();
  327. }
  328. }
  329.  
  330. @Override
  331. protected void onPause()
  332. {
  333. super.onPause();
  334. if(animation_!=null)
  335. {
  336. animation_.pause();
  337. }
  338. }
  339.  
  340. @Override
  341. protected void onStop()
  342. {
  343. super.onStop();
  344. stopGame();
  345. if(mazeView!=null)
  346. mazeView.setCanvas(null);
  347. mazeView = null;
  348. }
  349.  
  350. /**
  351. * Class that runs the animation thread
  352. */
  353. private class ThreadClass
  354. {
  355. private Thread thread_;
  356. private boolean running_;
  357. private MazeMaker parent_;
  358.  
  359. public ThreadClass(MazeMaker parent)
  360. {
  361. this.thread_ = null;
  362. this.running_ = false;
  363. parent_ = parent;
  364. }
  365.  
  366. public void start()
  367. {
  368. this.running_ = true;
  369.  
  370. if(this.thread_ == null)
  371. {
  372. this.thread_ = new Thread(new Runnable()
  373. {
  374. @Override
  375. public void run() {
  376. try {
  377. Thread.sleep(10);
  378. } catch (InterruptedException e1) {
  379. Log.e("Animation","Sleep at beginning failed");
  380. }
  381. while(running_)
  382. {
  383. updateScreen();
  384. try {
  385. Thread.sleep(20);//framerate of 50
  386. } catch (InterruptedException e) {
  387. e.printStackTrace();
  388. }//could add draw tracking to make sure sleeps exactly 20 seconds
  389. //and not just 20 seconds + the time it takes the frame to draw - TODO?
  390.  
  391. }
  392. }
  393. }, "Animation Thread");
  394. }
  395. try
  396. {
  397. this.thread_.start();
  398. }
  399. catch(Exception e) {}
  400. }
  401. private void updateScreen(){
  402. MazeView mv = parent_.mazeView;
  403. if(mv == null){
  404. //Log.e("Maze View","Maze View is still null, trying to reset before drawing");
  405. parent_.mazeView = (MazeView)parent_.findViewById(R.id.maze_view);
  406. if(parent_.mazeView == null){
  407. Log.e("Maze View","Maze View is eternally null, quitting this drawing cycle");
  408. return;
  409. }
  410. }
  411. try
  412. {
  413. mv.setCanvas( mv.getHolder().lockCanvas() );
  414. synchronized (mv.getHolder())//google said to >.>
  415. {
  416. parent_.drawGameContents(mv.getCanvas());
  417. }
  418. }
  419. catch (NullPointerException e)
  420. {
  421. Log.e("Drawing","Null Pointer when drawing: "+Arrays.toString(e.getStackTrace()));
  422. }
  423. catch(IndexOutOfBoundsException e){
  424. Log.e("Drawing","OBOE when drawing: "+Arrays.toString(e.getStackTrace()));
  425. }
  426. finally
  427. {
  428. if(mv.getCanvas()!=null)
  429. {
  430. mv.getHolder().unlockCanvasAndPost(mv.getCanvas());
  431. }
  432. }
  433. }
  434.  
  435. public void pause()
  436. {
  437. this.running_ = false;
  438. }
  439.  
  440. public void stop()
  441. {
  442. this.running_ = false;
  443. }
  444. }
  445.  
  446. @Override
  447. public boolean onTouch(View v, MotionEvent event) {
  448. //Log.e("Touch event",event.toString());
  449. int a = event.getAction();
  450. if(a==MotionEvent.ACTION_UP || a == MotionEvent.ACTION_CANCEL){
  451. if(path==null){
  452. path = new ArrayList<Point>();
  453. }
  454. else{
  455. path.clear();
  456. }
  457. pathPoint = new Point();
  458.  
  459. fingerOn = false;
  460. }
  461. else if(a==MotionEvent.ACTION_DOWN){
  462. if(path==null){
  463. path = new ArrayList<Point>();
  464. }
  465. else{
  466. path.clear();
  467. }
  468. pathPoint = new Point();
  469. fingerX = (int)event.getX();
  470. fingerY = (int)event.getY();
  471. handlePathPoint(fingerX,fingerY);
  472. Point temp = new Point((int)(fingerX/horizWallLength),(int)(fingerY/vertWallLength));
  473. if(temp.x == startX && temp.y == startY){
  474. Log.e("Path","Starting path at ("+temp.x+","+temp.y+")");
  475. path.add(temp);
  476. fingerOn = true;
  477. }
  478. }
  479. else if(a == MotionEvent.ACTION_MOVE){
  480. if(fingerOn){
  481. fingerX = (int)event.getX();
  482. fingerY = (int)event.getY();
  483. Point temp = new Point((int)(fingerX/horizWallLength),(int)(fingerY/vertWallLength));
  484. if(noWallsBetween(path.get(path.size()-1),temp)){
  485. handlePathPoint(fingerX,fingerY);
  486. if(!pointsEqual(path.get(path.size()-1),temp)){
  487. addAllBetween(path.get(path.size()-1),temp);
  488. Log.e("Path","Adding ("+temp.x+","+temp.y+")");
  489. path.add(temp);
  490. if(temp.x == endX && temp.y == endY){
  491. gameWon();
  492. }
  493. }
  494. }
  495. }
  496. else{
  497. Point temp = new Point((int)(fingerX/horizWallLength),(int)(fingerY/vertWallLength));
  498. if(temp.x == startX && temp.y == startY){
  499. handlePathPoint(fingerX,fingerY);
  500. path.add(temp);
  501. fingerOn = true;
  502. Log.e("Path","Starting path at ("+temp.x+","+temp.y+")");
  503. }
  504. }
  505. }
  506. return true;
  507. }
  508.  
  509. private boolean noWallsBetween(Point a, Point b){
  510. if(a.x!=b.x && a.y!=b.y){
  511. return false;
  512. }
  513. //return false in this special case because a = b, so no need to add more points to path
  514. /* I needed this for something with the fancy path
  515. else if(a.x == b.x && a.y == b.y){
  516. return false;
  517. }*/
  518.  
  519. else if(a.x == b.x){
  520. int min = Math.min(a.y,b.y);
  521. int max = Math.max(a.y,b.y);
  522. for(int i = min;i<max;i++){
  523. if(maze.hasSouthWall(i,a.x)){
  524. Log.e("Wall between","Failed: South wall at ("+a.x+","+i+")");
  525. return false;
  526. }
  527. }
  528. return true;
  529. }
  530. //a.y == b.y
  531. else{
  532. int min = Math.min(a.x,b.x);
  533. int max = Math.max(a.x,b.x);
  534. for(int i = min;i<max;i++){
  535. if(maze.hasEastWall(a.y,i)){
  536. Log.e("Wall between","Failed: East wall at ("+i+","+a.y+")");
  537. return false;
  538. }
  539. }
  540. return true;
  541. }
  542. }
  543. /**
  544. * Precondition: assumes in line, no walls between a and b
  545. * @param a
  546. * @param b
  547. */
  548. private void addAllBetween(Point a, Point b){
  549. //starts at a+1 because a is already in path
  550. //stops right before b, because b will get added after
  551. if(a.x == b.x){
  552. if(a.y>b.y){
  553. for(int i = a.y-1;i>b.y;i--){
  554. path.add(new Point(a.x,i));
  555. }
  556. }
  557. else{
  558. for(int i = a.y+1;i<b.y;i++){
  559. path.add(new Point(a.x,i));
  560. }
  561. }
  562. }
  563. //a.y == b.y
  564. else{
  565. if(a.y!=b.y){
  566. Log.e("AddAllBetween","Sanity check error, method was called when points were not in line");
  567. return;
  568. }
  569. if(a.x>b.x){
  570. for(int i = a.x-1;i>b.x;i--){
  571. path.add(new Point(i,a.y));
  572. }
  573. }
  574. else{
  575. for(int i = a.x+1;i<b.x;i++){
  576. path.add(new Point(i,a.y));
  577. }
  578. }
  579. }
  580. }
  581.  
  582. /**
  583. * Tells the user that they have successfully completed the game,
  584. * offers them multiple options for what to do next
  585. */
  586. private void gameWon(){
  587. Log.e("Game","You won!");
  588. AlertDialog.Builder dialog = new AlertDialog.Builder(this);
  589. dialog.setCancelable(false);
  590. dialog.setPositiveButton("Try a new maze", new DialogInterface.OnClickListener()
  591. {
  592. public void onClick(DialogInterface dialog, int id)
  593. {
  594. //restart
  595. resetMaze();
  596. dialog.dismiss();
  597. }
  598. });
  599. dialog.setNegativeButton("Quit", new DialogInterface.OnClickListener()
  600. {
  601. public void onClick(DialogInterface dialog, int id)
  602. {
  603. finish();//quit
  604. }
  605. });
  606. String s = "Congratulations! You solved the maze!\n";
  607. if(minLength >= path.size()-1){//maybe an oboe?.. who knows
  608. //if(minLength == 0){for testing
  609. s+="You made it from start to finish with the shortest path possible!";
  610. dialog.setMessage(s+"\nDo you want to quit or play a new maze?");
  611. dialog.show();
  612. }
  613. else{
  614. s+="However, there was a shorter path from start to end that was ";
  615. if(path.size()-minLength-1 ==1){
  616. s+= "1 space shorter.";
  617. }
  618. else{
  619. s+=(path.size()-minLength-1)+" spaces shorter.";
  620. }
  621.  
  622. dialog.setCancelable(true);
  623. dialog.setNeutralButton("Retry", new DialogInterface.OnClickListener() {
  624. @Override
  625. public void onClick(DialogInterface dialog, int id)
  626. {
  627. fingerOn = false;
  628. }
  629. });
  630. dialog.setMessage(s+"\nDo you want to play again, quit, or play a new maze?");
  631. dialog.show();
  632. }
  633.  
  634. }
  635. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement