Commit 221fd297 authored by Rominho15's avatar Rominho15
Browse files

Version 9.4.3 : Changement taille bonus, meilleur rebond sur les briques

parent 0560d11b
......@@ -149,6 +149,11 @@ public class GameController {
if(col != null) {
mp = MediaPlayer.create(context, R.raw.battouch);
mp.start();
mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
mp.release();
}
});
vx = col[0];
vy = col[1];
}
......@@ -160,6 +165,11 @@ public class GameController {
if(col != null) {
mp = MediaPlayer.create(context, R.raw.battouch);
mp.start();
mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
mp.release();
}
});
vx = col[0];
vy = -col[1];
}
......@@ -213,6 +223,11 @@ public class GameController {
if(collides(gameModel.getShoot(), b)){
mp = MediaPlayer.create(context, R.raw.brickdelete);
mp.start();
mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
mp.release();
}
});
gameModel.destroyShoot();
brickGroup.destroyBrick(b);
gameModel.getEvents().addScore(niveau);
......@@ -425,7 +440,7 @@ public class GameController {
if (circleDistance.y > (rect[3]/2 + circle[2])) { return 0; }
if (circleDistance.x <= (rect[2]/2)) { return 1; }
if (circleDistance.y <= (rect[3]/2)) { return 1; }
if (circleDistance.y <= (rect[3]/2)) { return 2; }
int cornerDistance_sq = (circleDistance.x - rect[2])^2 +
(circleDistance.y - rect[3]/2)^2;
......
......@@ -6,7 +6,7 @@ package com.example.rleger.cassebrique.Model;
public class Bonus {
private float x;
private float y;
private int rayon = 5;
private int rayon = 7;
private int speed = 2;
public Bonus(int xi, int yi, int s) {
......
......@@ -26,6 +26,11 @@ public class MainActivity extends AppCompatActivity {
mp = MediaPlayer.create(this, R.raw.beautiful);
mp.start();
mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
mp.release();
}
});
}
/**
......
Supports Markdown
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