Tuesday 28 May 2013

Forward!

AAAAAAAAAH!! My character can move through rooms now! :D
Well... technically, it's just two rooms. Forward and Back. But still. Yay. Although if I press back again after they are in the start room, I get a massive error on the black screen (I need to learn the name of that box!), plus the screen turns white since there's nothing before the beginning.
There was a slight problem in the beginning because I forgot to add the MouseListener to the buttons! I am so smart sometimes. >_>
Another problem was that I had to use the removeAll() method and put the other picture into the CENTER layout, which means I probably have to declare the Forward, Back, Right, and Left buttons all the time. I didn't do that at first, so the program didn't work at the time. But it works properly afterwards.
Maybe I can put them in a method and just use the method whenever I need them. I haven't tried that yet but I don't see why it won't work.
Just yeah. I can see that I'm going to have more if statements than I've ever used for any of my other programs put together.

No comments:

Post a Comment