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 

Wednesday, 15 May 2013

For Future Reference

I just realized that for the sake of the board, the index numbers would be: 

0 - Start Adventure 
1 - Borgin and Burkes
2 - Room of Requirement
3 - Roland Kerr College
4 - Camelot's Annual Tax
5 - Tardis
6 - Redhaven 
7 - Room of Requirement
8 - Piccadilly Circus
9 - St. Mungos
10 - Platform 9.75
11 - Speedy's Cafe
12 - Avalon 
13 - Isengard
14 - Taxi
15 - Grimmauld Place
16 - Room of Requirement
17 - Quidditch Pitch
18 - Tavern
19 - Hagrid's Hut
20 - Room of Requirement
21 - Aslan's Country
22 - Wardrobe 
23 - 221B Baker Street
24 - Northumberland Street
25 - Beaversdam
26 - Ministry of Magic 
27 - Go to St. Mungos
28 - Mordor
29 - Bagshot Row 
30 - Room of Requirement 
31 - Hogwarts Express
32 - Ealdor
33 - Room of Requirement
34 - Citadel 
35 - Hogwarts 

OOPS!

I was trying to add the frames onto the screen again this morning, and I realized half way in that when I clicked on the rightmost property, it wouldn't work again!!

Until I realized I have to add the JLabels and the frames backwards, as well...

I'm smart aren't I -__- 

So I had to go back and redo all the loops and redo all the names of the things. 

JLayered Panes are just great >_< THEY ARE ALL BLOODY BACKWARDS! :o 

GAAAAAA. It looks pretty okay now, though, I hope. 



Tuesday, 14 May 2013

Hello!

I found out what the stupid error was...I initialized the wrong number of array positions (yeah, i know, stupid enough). 

I also found out why the label things were all appearing backwards. I added everything in terms of the board rather than in terms of the individual arrays. And for both the South and the West border, they had to be added starting the left side (for south) and the top (for west) rather than in the direction of the board. 

Yeah, really idiotic error O-o 

Program won't run O_o

So confuzzzling. I don't geddit. 

I have an array of 40 objects that are received from other classes. And when I try to put something in index 37, it says nullPointerException...


Sunday, 12 May 2013

A bit more monopoly looking

As you could see on the previous picture, it was hard to read with the screen size so small. So I have created an array of JButtons and and array of JLabels with all the image icons both for the small icons and the larger icons. 

The JButtons and the larger icons of JLabels will all be displayed in another frame, one where the user can see and read the tile. 


And yes :D The prices are all in galleons ;P 

FANDOM STYLE! 

Saturday, 11 May 2013

Finallies :D

HELLO AGAIN!

I shouldn't get too excited since I haven't done a whole lot, but I redid the code and it went by really quickly. So here's the updated picture of what the board looks like. And in the for loop, I've added everything to the mouseListener so it doesn't have to be done manually! 



Thursday, 9 May 2013

And he does his thing again ;P

Ryk gave me another way to program the thing, so I'm going to change around my code again to accommodate that, cause it's a lot more efficient. 

Basically, what his way, to do it was: 

Use a class to extend all the JLabels. 

To print all the for loops to the screen, name all the properties in order and a counter at the same number. Therefore, you can use a loop to create the labels (in an array), and do it individually for north, east, south and west. 

He also said that it 'twas possible to do it for both east and west at the same time but I was too confuzzled..

Properties :)

So here is the official gameboard on paper and it makes it a lot easier to program :) 

Hurray! :D

So I've finally finished the game board set up. I'm going to have to program the layeredPane part, so that when the pawns move, the user can see their pawns. But for now, at least, it's amazing


Now, I'm going to have to add all these labels into the class declaration where when the user clicks the properties, a frame will show up with the more massive pictures. 

And I formatted it much better, so here is the official gameboard: