Tuesday, 21 May 2013

X and Y Coordinates

Well, I haven't even had a chance to do X and Y coordinates - I'll do this when I get home. Cause I'm busy fixing Selva's program. I've chosen my five pawns here:











So to do some initial while Selva is asking someone in our class something about our program, here are some initial calculations. 

My frame size is 1200 by 1200. On the North boundary, though, there are 10 properties. This means that the width must be found of each property (or at least the average cause they vary by a small amount from 1-2 pixels). It's not that big of a deal, but here goes. 

The average size of all the game board things are 114 * 80. This means that the height is 80; and the width is 114. Therefore, for the north boundary, it will end up in the middle on the left side of properties. I just hope it's mostly visible. So the x-coordinate would be 40 on that side, and it would not change for the North Boundary. 

For the east  boundary, the y-value will remain the exact same - so the width would be 114*10 = 1140; meaning that's the end of the boundary. I can then calculate how much the difference would be so I can put it down the left sides. This will increase while going down the y-axis. Oh, and I haven't done any of this programming yet. Selva's just drawing out the game board to determine how to structure the for loop, so I'm sort of ranting on here about the program. It's really great for brainstorming what to do. 

Oh, and for south boundary, the x-value would remain the same just as it was with the north boundary because there are 10 properties on each end. The width of each property must be found and subtracted from the initial position. It must be subtracted because while moving towards the origin, unlike a normal graph in mathematics, the graph goes the opposite direction. The top left corner is the origin, having the coordinates of (0, 0); while moving to the right (but staying on the x-axis), the value increases just as it does in quadrant 4. However while moving from point (0, 0) and moving downwards, the y-value will increase. This means that the graph has therefore been flipped and anything below the x-axis is positive. It is pretty counterintuitive, which is why the positioning of this was so difficult to think about, but when you think about it in context, it really isn't that much. 

And as said before, in the west boundary, the y-value will remain the same and the height of each square (or at least the average - most likely going to be 80); will be subtracted from the initial position. 

>____<

Fiesicks is throwing me down the drain. Half of me is saying it's fun and I should take it next year; the other half is saying you're killing yourself o_o 

I should have been done moving the pawns by today, or at least finding the coordinates. Looks like ICS is going to be preeeety busy today o.O 

Anyways, for ICS, I'll probably just end up finding the coordinates of the individual square pieces, and I can find them out on Mac as well. That can then divided by wherever I want to put the pawns on the board, and then add the width of one square each time. But I feel like they should be big enough to see from the small tiny board, so I think I might make them a blackshadow or something of Hermione's face, but that's something to talk about later. 

Ryk said that while starting from the top, it will keep adding the width to the x-value. While going down, it will keep adding the height to the y-value. But while doing from right to left on the bottom, it's going to be decreasing the x-value. And finally, for the last side of the board - bottom to top on the west side of the border panel, it will be decreasing the y-value by the height - not the width. I think the best way to do this is in a for loop, but I have to hurry up. 

Also, I am going to limit this game to 2 users - one player and the Computer. So every time they click on "buy property," which is in a JLabel, the program will take a certain amount off of their bank card (more like their Gringotts account). 

Anyways, physics test tomorrow - after that's done, I can finally squeeze computer science in. If I end up finishing the movement of pawns today, then I'll start on using the mouseListener and taking off a certain amount (which is in an objects array) out of the person's gringotts account. 

Also, for Room of Requirement, that's another thing that I have to program. I have it all down, and I know all my cards, which I have already posted here for everyone to see, but shh! So...yeah, tons to do, and I'm going to finish the plotting by today; the if statements by Thursday and the room of requirement by Friday.

As much as I love programming, I can't wait until school's over. I'll be able to refine this program a lot more in the summer if I'm not too busy reviewing Advanced Functions, Calculus and Vectors, Data Management, Grade 12 Computer Science, Physics, or Earth and Space Science. Anywhoozing, it would be a lot more fun to refine this program so I can accommodate up to 8 players and make it like the real version. But for now, time is of the essence and I have to finish it and make sure that there are no bugs...fast! I'm almost thinking that I shouldn't give them houses and hotel options, but that sort of breaks the whole point of monopoly, but I'll see how far I get up to...I really do hope I have time for it because Monopoly isn't Monopoly without houses and hotels. I'll have to run it by Ryk to see if he's okay with it before I make up my mind. Not that it's made up..any time yet. I'll find out by Saturday..