Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 6 - Part II
Date: Tue Dec 4 2001 9:49 pm
Author: White, David <white3@andrew.cmu.edu>
Subject: Easier GUI picking fix...

I got tired of trying to place the pieces exactly in the right
spot. I figured out how to change the GUI to give a bigger
pick tolerance...

Do the following to GraphicsGame.java
This is in the function: getNode of the MouseTest class. Comment out the following lines as shown, then replace with code following. I just made the range larger by 8 pixels in each direction... Seems to be much easier now...
//                         if (14//                                 tempy=1;
//                         else if (87//                                 tempy=2;
//                         else if (158//                                 tempy=3;
//                         else if (227//                                 tempy=4;
//                         else if (297//                                 tempy=5;
//                         else if (368//                                 tempy=6;
//                         else if (436//                                 tempy=7;

//                         if (93//                                 tempx=1;
//                         else if (168//                                 tempx=2;
//                         else if (239//                                 tempx=3;
//                         else if (308//                                 tempx=4;
//                         else if (378//                                 tempx=5;
//                         else if (448//                                 tempx=6;
//                         else if (516//                                 tempx=7;
if (8                                tempy=1;
                        else if (71                                tempy=2;
                        else if (150                                tempy=3;
                        else if (219                                tempy=4;
                        else if (289                                tempy=5;
                        else if (360                                tempy=6;
                        else if (428                                tempy=7;

                        if (85                                tempx=1;
                        else if (160                                tempx=2;
                        else if (231                                tempx=3;
                        else if (300                                tempx=4;
                        else if (370                                tempx=5;
                        else if (440                                tempx=6;
                        else if (508                                tempx=7;
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
GreedyPlayer broken?      White, David      Tue Dec 4 2001 4:17 pm       
Re: GreedyPlayer broken?      Shi, Ying      Tue Dec 4 2001 4:19 pm       
Re: GreedyPlayer broken?      Maxim, Michael G.      Tue Dec 4 2001 5:43 pm       
Re: GreedyPlayer broken?      White, David      Tue Dec 4 2001 8:13 pm       
Easier GUI picking fix...      White, David      Tue Dec 4 2001 9:49 pm       
Re: Easier GUI picking fix...      White, David      Wed Dec 5 2001 8:25 am       
Re: GreedyPlayer broken?      White, David      Tue Dec 4 2001 9:26 pm       
Re: GreedyPlayer broken?      Fields, David C.      Wed Dec 5 2001 2:33 am       
Re: GreedyPlayer broken?      White, David      Wed Dec 5 2001 8:22 am       
Re: GreedyPlayer broken?      Fields, David C.      Wed Dec 5 2001 10:24 am       
Re: GreedyPlayer bro...      Liu, Limin Angela      Wed Dec 5 2001 6:24 pm       
Re: GreedyPlayer ...      White, David      Thu Dec 6 2001 10:24 am       
Re: GreedyPlayer broken?      Dozzi, Giancarlo      Fri Dec 7 2001 1:32 pm       

Back to previous screen