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. 

Thinking about the game in general now, I am planning to keep it at a limit of 2 players - the computer and you, the user. So every time "buy" property is pressed, Gringotts will subtract the price of the property off your account. But with that being said, every time the computer lands on a computer, the user will get a JOptionPane with a MESSAGE_DIALOG saying that the computer has now purchased this property: _____. 
Computer's Total Money: ____ Galleons.
Computer's Total Room of Requirement: _______ (The name of the card - ex: Get out of St. Mungo's Free Card). 

Yeah, I know, I ranted quite a lot here, but oh whatever! ;D It's going to be so much fun to play when it's done :) All the fandoms combined into one. 

Actually, if I say it that way, I wonder if I should use a random number generator to determine the computer's name rather than just say, "Computer". That's a bit boring. 

And with that said, I think I might just make an Instruction Screen cause I don't have time to make a JMenu, or learn how to do it.

2 comments:

  1. Awesome pawns! Although it's weird thinking of them as pawns of a game xD
    And what would the computer name actually randomly generate into...?

    ReplyDelete
    Replies
    1. Haha ^_^ Thanks.

      Oh, just the name of the "player" :) Like...like........LIKE THE COMPUTER CAN BE CALLED HERMIONE!

      Or it can be a Com Pewter :)

      Delete