...
 
Commits (2)
......@@ -2,11 +2,11 @@
#################
#****** ******#
# #*# #*#*# #*#*#
#b** *#* ***#
#*** *#* ***#
#*#*# #*# # #*# #
#*******# *****#
#p#*#*#*#*#*### #
# ******#*** r#
# b*****#*** r#
# #*# #*#*#*# #*#
#*******#*******#
#*# #*#*# #*#*# #
......
......@@ -8,7 +8,7 @@
#*#*#*#*#*#*#*#*#
#*#*#*#*#*#*#*#*#
#*#*#*#*#*#*#*#*#
# ****** #
# *****b #
############### #
#p #
#################
......
......@@ -122,8 +122,8 @@ public class Board implements IRender {
_game.playerSpeed = 3;
_game.bombRadius = 1;
_game.bombRate[0] = 1;
_game.bombRate[1] = 1;
_game.setBombRate(0,1);
_game.setBombRate(1,1);
}
......
......@@ -48,7 +48,6 @@ public class Game extends Canvas {
//can be modified with bonus
protected static int[] bombRate = {BOMBRATE, BOMBRATE};
protected static int bombRadius = BOMBRADIUS;
protected static int playerSpeed = PLAYERSPEED;
......@@ -62,7 +61,7 @@ public class Game extends Canvas {
private Board _board;
private Screen screen;
private Frame _frame;
private static int[] bombRate;
//this will be used to render the game, each render is a calculated image saved here
private BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);
private int[] pixels = ((DataBufferInt)image.getRaster().getDataBuffer()).getData();
......@@ -73,7 +72,8 @@ public class Game extends Canvas {
_frame.setTitle(_title);
screen = new Screen(WIDTH, HEIGHT);
_input = new Keyboard();
_board = new Board(this, _input, screen, this._frame._serverGame, this._frame._playerNum, level);
_board = new Board(this, _input, screen, this._frame._serverGame, this._frame._playerNum, level);
bombRate = new int[]{1,1};
addKeyListener(_input);
}
......@@ -189,6 +189,10 @@ public class Game extends Canvas {
return playerSpeed;
}
public static void setBombRate(int num, int bombNb) {
bombRate[num] = bombNb;
}
public static int getBombRate(int num) {
return bombRate[num];
}
......@@ -207,6 +211,8 @@ public class Game extends Canvas {
public static void addBombRate(int i, int num) {
bombRate[num] += i;
if (i>0)
System.out.println("AU BOMB RATE For player "+num+" = "+bombRate[num]);
}
//screen delay
......