In the Actor class 'Piece', I put a STATIC String variable of length 1, which contains the type of piece represented the same way as in position. (Uppercase characters for White pieces and lowercase for Black) spaces signifies an empty square. It has a STATIC String variable of length 64 that describes the position: 'B' for White Bishop, 'b' for Black Bishop 'R' for White Rook, 'r' for Black Rook etc. I did control TURN in World, but I also controlled the board there. I will eventually add the neccessary buttons and info boxes to make it more friendly and combine the scenarios. Actually both scenarios that I uploaded were the same program, but I set the int mode variable in World which can be set using method resetBoard(int mode). This was my first project using Greenfoot and the Java language. In the past, I have programmed mainly in Basic and Assembly (before Windows was introduced) also had touched on Fortran. I am fairly familiar with programming, but never worked with Java or Greenfoot previously. First time ever in 'Discuss' for me today.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |