Commit 546b8478 authored by Rominho15's avatar Rominho15
Browse files

Version 7.2 : Gestion des niveaux en multijoueurs

parent 9e01888d
......@@ -55,7 +55,7 @@ public class GameController {
// place la batte en dessous de la balle
int batX = gameModel.getGround().getCenter().x;
int batY = 3*gameModel.getGround().getCenter().y/2;
int batY = 5*gameModel.getGround().getCenter().y/3;
// met à jour la position de la batte dans le modèle
gameModel.getBat().setX(batX);
......@@ -66,7 +66,7 @@ public class GameController {
if(gameModel.getBat2() != null) {
// place la batte en dessous de la balle
int bat2X = gameModel.getGround().getCenter().x;
int bat2Y = gameModel.getGround().getCenter().y/2;
int bat2Y = gameModel.getGround().getCenter().y/3;
// met à jour la position de la batte dans le modèle
gameModel.getBat2().setX(bat2X);
......
......@@ -22,8 +22,6 @@ public class GameModel{
if(p == 2)
bat2 = new Bat(50,50);
Log.e("bat2",""+bat2);
ball = new Ball(15,15);
events = new Evenements();
brickGroups = new ArrayList<>();
......@@ -126,6 +124,10 @@ public class GameModel{
int x = distL;
int y = distH;
if(getBat2() != null)
y = ground.getHeight()/3;
for(int i=0 ; i<nbBricksY ; i++) {
for(int j=0 ; j<nbBricksX ; j++) {
switch (j) {
......@@ -211,6 +213,9 @@ public class GameModel{
int x = distL;
int y = distH;
if(getBat2() != null)
y = ground.getHeight()/3;
for(int j=0 ; j<nbBricksY ; j++) {
for(int i=0 ; i<nbBricksX ; i++) {
switch (getColor2(j,i)) {
......
......@@ -191,7 +191,7 @@ public class GameView extends View {
canvas.drawRect(xBat2, yBat2, xBat2 + wBat2, yBat2 + hBat2, paintBat2);
// Curseur
canvas.drawCircle(xBat2 + wBat2 / 2, yBat2 - hBat2 - 20, 7, paintBall);
canvas.drawCircle(xBat2 + wBat2 / 2, yBat2 - 20, 7, paintBall);
}
for (int g=0 ; g < gameControlleur.getGameModel().getBrickGroupsSize() ; g++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment