Wednesday, 14 November 2012

Filling A 2-D Array with a Self Defined Room Class


I have just filled the 2-D Array that is store my map with different rooms. The rooms are defined in a Room Class which can be seen bellow as well as the code for the filling of the 2-D Array. As of yet I am having trouble accesing the data from these rooms. :(


public class Room {
 int RmNo;
 Boolean North;
 Boolean East;
 Boolean South;
 Boolean West;
 String RmName;

 public Room(int number, Boolean N, Boolean E, Boolean S, Boolean W, String name){

 int RmNo = number;
 Boolean North = N;
 Boolean East = E;
 Boolean South = S;
 Boolean West = W;
 String RmName = name;
 
 }
}



public class GlobalDataStore {
 public static Room[][] Rooms = new Room[5][5];{

 Rooms[1][1] = new Room(1, true, true, false, false, "Entrance Chamber");
 Rooms[1][2] = new Room(2, true, true, false, false, "Main Hall");
 Rooms[1][3] = new Room(3, true, true, false, false, "Pantry");
 Rooms[1][4] = new Room(4, true, true, false, false, "Boudoire");
 Rooms[1][5] = new Room(5, true, true, false, false, "Kitchen");
 Rooms[2][1] = new Room(6, true, true, false, false, "Scullery");
 Rooms[2][2] = new Room(7, true, true, false, false, "Throne Room");
 Rooms[2][3] = new Room(8, true, true, false, false, "Toilet");
 Rooms[2][4] = new Room(9, true, true, false, false, "Trophy Room");
 Rooms[2][5] = new Room(10, true, true, false, false, "Dining Chamber");
 Rooms[3][1] = new Room(11, true, true, false, false, "Bedrooms");
 Rooms[3][2] = new Room(12, true, true, false, false, "Jousting Room");
 Rooms[3][3] = new Room(13, true, true, false, false, "Garden");
 Rooms[3][4] = new Room(14, true, true, false, false, "Fountain");
 Rooms[3][5] = new Room(15, true, true, false, false, "Fishing Hut");
 Rooms[4][1] = new Room(16, true, true, false, false, "Courtyard");
 Rooms[4][2] = new Room(17, true, true, false, false, "Library");
 Rooms[4][3] = new Room(18, true, true, false, false, "Hidden Chamber");
 Rooms[4][4] = new Room(19, true, true, false, false, "Basement");
 Rooms[4][5] = new Room(20, true, true, false, false, "Torture Chamber");
 Rooms[5][1] = new Room(21, true, true, false, false, "Basement 2");
 Rooms[5][2] = new Room(22, true, true, false, false, "Treasure Room");
 Rooms[5][3] = new Room(23, true, true, false, false, "Annex Of Doom");
 Rooms[5][4] = new Room(24, true, true, false, false, "Chamber Of Awakening");
 Rooms[5][5] = new Room(25, true, true, false, false, "End Room");
}
}

Tuesday, 16 October 2012

Project Specification

Just handed in my project specification which includes:
- Scope And Boundaries
- Resources Required   
-Inputs, Processes And Outputs
-Feasability Study
-Comparison Of Programming Environments
- My Proposed User Interface
- A List Of Data Structures
Now going to continue reading Java and planning my code.


Tuesday, 4 September 2012

Project Proposal

Project Proposal


My project will be an adventure game where the player will navigate a series of rooms represented by a 2-D Array. The main objective of the game will to reach the boss room where they will battle a boss like creature (possibly randomly generated). After the boss room there will be a series of 'bonus' rooms sorted according to the difficulty (level) of each monster present in the room (will be randomly generated). The battles will be done via a function or procedure which I will right which will affect variable such as: Player Health, Player Energy, Enemy Health, Enemy Energy etc.

The program will either be presented in a completely text based format e.g. a C++ Console Program, A visual basic Interface where the main output will be in text but there will still be various buttons and GUI elements for the user to interact with or possibly coded in Java with a full GUI with moving sprites and background.