Monday, 27 May 2013

STUPID BLOODY BIOLOGY!

UGH! Fudging biology...test today - and it's putting everything off. I should be programming! Well, I am now, but again, I'm behind schedule! 

That's the downside of having a student teacher who has almost no idea what she's teaching cause she cannot answer extra questions that well; and testing on things that go into way toooo much detail! How on earth am I supposed to memorize the a chart that has a bunch of random words. 

This is why I like computer science, the more you use something, you just memorize it. You do not have to try to memorize something! 

Anyways, back to computer science. I'm current programming the room of requirement that goes inside of the mouseClicked method; cause I have to finish taking off all the points from the user and displaying how much they have by today. And then probably doing the same for the computer for tomorrow.

So I've started programming the north button pressing. This will take off money from both computer and user bank account: 

So this is obviously, what happens when you click on the property. I'm going to have to find a way to make sure that the user can't buy a property that they aren't on, so that's another thing that I have to do. 

Here, I'm clicking the button. 

This is what prints on the screen telling the user that we have given then 200 galleons. 

This will show up on every screen - which tells the user how much money each person has.

This is an example of pressing the Room of Requirement button. 

You will not always get this option, it is on a random number generator; that has up to 8 options for now. Time permitting, there may be more, but there are 8 for now. 

As said before, this screen is always going to pop up after buying or picking up a card. 

Another round of room of requirement if you land on it a second time. 

This is another possible outcome, there are 6 more :) 

As said before, this will display whenever a button is pressed! 

Saturday, 25 May 2013

Hard Deadlines

Going to finish all the JOptionPanes by Monday. 

Going to finish all the pawn movement by Wednesday. 

And decide and finish all the houses and hotel business by Saturday. 

Culminating time, tons of stuff to do, and not enough time to run around like a chicken. 

Although I wish I could. 

I wish I worked with Sherlock and chased taxis. 
Or went to Hogwarts to study stuff at Hogwarts. 

Oh well, life is life. 


Friday, 24 May 2013

Forgot to post yesterday!

Ryk found out what the error was. The JOptionPane was showing up on the screen, but somewhere off the screen. So he said to specify the panel instead of the null inside the declaration of the JOptionPane. 

AND IT WORKED! 

It's always one word -__- 

Thursday, 23 May 2013

Buying Properties

I haven't sorted out the buying properties part either. I'm working that along with the pawns. 

Although I'm doing the purchasing of properties first. So, basically if any of the buttons are pressed saying "Buy Property"; for example, the price of the property will be taken off of the user's account. On top of it, the property that they have purchased will change to "true" for owned and so the computer cannot buy that property, too. They may land on it accidentally and be forced to pay rent. 

And I've run into a weird error. Cause in the mouseListener, I am testing it to see if the user presses it. So, if it is pressed, a certain thing will happen. An example of this: 

For the "I'm going on an adventure!" square, the user is supposed to gain 200 galleons. It seems not-really-user-friendly to just take it off their gringotts account without telling them, so I created a JOptionPanel to let them know so that they could just press okay or something. But it isn't working. The JOptionPane is making the program well, just die, really. It prints out what is in the if statement into the console window. And that's perfectly good, but the user kind of needs to know how much money they have! 

Oh. I see. Unless I put a JLabel in the centre showing the amount of money he or she has. But it looks much better in the JOptionPane so I'm going to try to get that working first. 

Placement of Pawns: South and West

ONTO THE SOUTH PART OF THE PROGRAM! 

Tavern:  (1061, 580)
Hagrid's Hut: (947, 580
Room of Requirement: (883, 580
Aslan's Country: (719, 580)
Wardrobe: (605, 580
221 B Baker Street: (491, 580
Northumberland Street: (378, 580
Beaversdam: (263, 580)
Ministry of Magic: (149, 580
Go to St. Mungos': (30, 580

ONTO THE WEST PART OF THE PROGRAM! 

Mordor: (30, 580) 
Bagshot Row: (30, 500) 
Room of Requirement: (30, 420)
Hogwarts Express: (30, 340) 
The Ealdor: (30, 260)
Room of Requirement: (30, 180)
The Citadel: (30, 100)
Hogwarts: (30, 20)

Wednesday, 22 May 2013

Placement of Pawns: North and South

HEEERE GOES! 

For the north boundary, the screen size is 1200. There are 10 JLabels on the top row. The size is 114 by 80. But I think I'm going to add about 5 pixels of extra room just in case because there is quite a bit of white space. 

Therefore, for the north boundary, the x-value would start at (40) and would start at y-value (30) <-- give or take a few. 

Start Adventure --> (30, 40) 
Borgin and Burkes --> (149, 40
Room of Requirement --> (263, 40
Roland Kerr College --> (378, 40
Camelot's Annual Tax --> (491, 40)
Tardis --> (605, 40
Redhaven --> (719, 40
Room of Requirement --> (833, 40
Piccadilly Circus --> (947, 40) 
St. Mungos' Hospital --> (1061, 40) 

For the east boundary, the length of the screen size is 1200 but there is a lot less room. 

Platform 9 and 3/4: (30, 20) 
Speedy's Cafe: (30, 100)
Avalon: (30, 180) 
Isengard: (30, 260) 
Taxi: (30, 340) 
Grimmauld Place: (30, 420) 
Room of Requirement: (30, 500) 
Quidditch Pitch: (30, 580) 

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..

Saturday, 18 May 2013

Movement of Pawns

For the movement of pawns, that's a bit more difficult because I have to add the graphics object to a JLayeredPane where it will individually add the pawn onto each sort of, part of the gameboard. Anywhoo, thought I'd get that down here in writing, anyways. 

I'm sort of falling behind schedule cause I still have to find out how to keep track of the number of people who are playing - I think I might just limit it to Computer and 1 Player for now, might extend it later, but time is of the essence right now. 

Also, I still have to test for input on each of the buttons that are pressed because otherwise, the people can't buy properties. 

I've been thinking about it, and I think I'll make it an array of objects (yes, another one) that contains a long variable for the amount in your account, and an int variable for the number of houses or hotels that you have on a specific property. 

But I might not even have time for all those parts of the program..so, I really don't know....

BLOODY EXAMS! IF NOT FOR EXAMS, I MIGHT HAVE MORE TIME TO MAKE THE PROGRAM FUNNER. 

Thursday, 16 May 2013

Room of Requirement

So I've been thinking about the "chance" and "community chest" cards which will all be determined  by random number generators (using Math.Random): 


  • Start your adventure again. You may collect 200 galleons
  • The Goblins perform an error while processing your account as they withdrew 100 galleons from yours instead of Voldemort's. To compensate,  Gringotts pays you 50 galleons
  • Your father falls ill, and you must visit the Court Physician, Gaius. Under normal circumstances, he wouldn't charge you, but this time, he asks for gold. You must provide him with 50 galleons otherwise he'll tell the King that you are a sorceress/sorcerer. Do you give him 50 galleons or risk him exposing your secret?
  • Your friends are annoying you, and with a very random thought, you try to erase their memory. Your wand backfires and you have no recollection of who you are, what you're doing, or how you got to where you were. Go to St. Mungos, now.
  • Get out of St. Mungo's Free Card. 
  • Happy happy birthday! Collect 20 galleons from each player and enjoy!
  • You and all your friends decide to spend money on the Chinese Theatre. Yes, that same one that John and his date (plus Sherlock). However, Sherlock only has 3 free tickets, no more, no less. All other players must pay 50 galleons. You, the person who picked up this card must chip in 10 galleons.
  • When Uther married a troll whom was so greedy for money, he charged too much from your Gringotts account. He compensates you for a 40 galleons refund. 
  • Morgana has declared war on Camelot. She is using you to get through to King Arthur. You, can use magic and stop her (but then everyone else will know that you have magic); or you can let her do her worst. What do you do?
    • If you choose to use magic and stop her, you receive 40 galleons per house and 115 galleons per hotel. 
    • If you choose to let her do her worst, you must pay 40 galleons per house and 115 galleons per hotel because Morgana has increased taxes on your land.
  • Advance to Ministry of Magic
  • Advance to the nearest transportation spot (Taxi, Tardis, Wardrobe or Hogwarts Express). If it is unowned, you can buy this from the bank. If it is owned, roll the dice a second time and pay the owner 10 times the sum of the die. 
  • Advance to Bagshot Row. If you pass go, collect $200. 
  • Go backwards seven spaces. 
  • Advance to Hogwarts. If it is unowned, you may buy this from the bank. If it is owned, pay the owner double the rent. 
Of course there are some monopoly things that aren't in the classic version, but it sounds super fun ;D