Tuesday, 28 May 2013

Back to the same problem.

Hi. 

I'm back to the same problem again. 

Ryk says that the programming of pawns should be quite easy, but it's so confusing. 

There's white space between north and south properties, and so just increasing it by 117 doesn't work because it will keep moving left, and possibly even into the white space causing the player to not even know where he or she is. 

North Coordinates for User: 



X Coordinate
Y Coordinate
2
48
19
48
141
48
258
48
377
48
498
48
612
48
733
48
849
48
980
48

North Coordinates for Com Pewter: 


X Coordinate
Y Coordinate
2
48
95
48
211
48
330
48
443
48
562
48
686
48
802
48
902
48
1,067.5
48


 East Coordinates for Com Pewter: 


X Coordinate
Y Coordinate
1151.875
35
1151.875
112
1151.875
189
1151.875
261
1151.875
338
1151.875
415
1151.875
493
1151.875
568


 East Coordinates for User: 


X Coordinate
Y Coordinate
983.125
35
983.125
112
983.125
189
983.125
261
983.125
338
983.125
415
983.125
493
983.125
568

 I'm not going to bother out writing out the west and the south, as they are the exact same ones as the ones here, but flipped where I'm going from bottom to top and decreasing the value. 

So I didn't really use math doing this, because it was very difficult to find. And, so I used the mouseClicked method to find out the x-coordinate at which the dice button was being clicked at, so i could substitute that value into the one in North. I estimated the end ones, and I will test them out tomorrow. 

For the east value, I just clicked the button in the middle of the labels, to get the y coordinates and I substituted those into the East values. 
 

...

I tried to use the mouseClicked method (adding the entire pane to the mouseListener); and find the first coordinates. But, it isn't really going well cause the program didn't print out the x-coordinates at which I clicked on. 

And I estimated about where I would put the first pawn, and it didn't work. So I don't really know why - I'll find out later tonight,  I guess. 

I'll try to focus on Intro to Anthro/Social/Psych until probably 5:30 when I get entirely tired of the course, and go back to programming cause it is just so much more rewarding. 

But I really, do, need to find out why the pawn placement isn't showing up. Perhaps the icon wasn't being created or something, although I did create it, but I'll find out soon enough. 

X-Coordinates and Y-Coordinates (AGAIN!)

Asked Ryk again, what would happen for the pawns (because I have to finish it by Friday; and the instructions by Sunday): 

While moving the pawns, it's a similar if statement: 

if (coordinate is too far out of range)
{
Change the coordinate by a certain amount to make it turn.
}

So, it would work using the coordinates that were found previously. 

And it would work using a "getX();" and "getY();" to find out where exactly where to put the icons. I should have 2 set coordinates - one for the user and one for the computer. Probably top and bottom would work on the left side. Though I have to find a way to be able to see the coordinates. 

I just tried it, and the mouseMoved, the mouseDragged, mouseMoved, mouseClicked didn't work. Until later.....>_<