Skip to content
Snippets Groups Projects
Commit fc6fddc3 authored by bettinasmid's avatar bettinasmid
Browse files

kevesebb luk, nagyobb pálya a tárgyak miatt

parent 5b92c2cc
Branches
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@ public class Board {
public Board(int field_num , int column_num, int player_num) {
fields = new ArrayList<Field>();
int holesOnBoard = 0;
ArrayList<Item> essentials = new ArrayList<Item>();
essentials.add(new Item("Pistol")); essentials.add(new Item("Flare"));essentials.add( new Item("Cartridge"));
ArrayList<Item> otheritems = new ArrayList<Item>();
......@@ -32,8 +33,16 @@ public class Board {
for(int i = 0; i < field_num; ++i) {
if(i % 2 == 0)
fields.add(new StableField(rnd.nextInt(5), (Item)null));
else
fields.add(new UnstableField(rnd.nextInt(5), rnd.nextInt(player_num),(Item)null));
else {
if(holesOnBoard == 2) //so that there won't be too much holes
fields.add(new UnstableField(rnd.nextInt(5), rnd.nextInt(player_num-1)+1,(Item)null));
else {
UnstableField uf = new UnstableField(rnd.nextInt(5), rnd.nextInt(player_num),(Item)null);
fields.add(uf);
if(uf.getCapacity() == 0)
holesOnBoard++;
}
}
}
//place essential objects on stable fields
while(essentials.size() != 0){
......
......@@ -183,7 +183,7 @@ public class GameWindow extends JFrame{
UIManager UI=new UIManager();
UI.put("OptionPane.background", new Color(255, 255, 255));
UI.put("Panel.background", Color.white);
String[] size = {"3", "4", "5", "6", "7"};
String[] size = {"4", "5", "6", "7"};
String[] players = {"2", "3", "4", "5", "6"};
String[] difficulty = {"CakeWalk", "Saturdy afternoon", "Sure?", "You are kidding!", "White hell"};
JComboBox<String> combo = new JComboBox<>(size);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment