Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LEGER ROMAIN
CasseBrique
Commits
50c283c0
Commit
50c283c0
authored
Jan 23, 2016
by
Rominho15
Browse files
Version 9.4.4 : réglages minimes
parent
221fd297
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/example/rleger/cassebrique/Controller/GameController.java
View file @
50c283c0
...
...
@@ -4,7 +4,6 @@ import android.content.Context;
import
android.content.Intent
;
import
android.graphics.Point
;
import
android.media.MediaPlayer
;
import
android.util.Log
;
import
android.view.Display
;
import
android.view.WindowManager
;
...
...
@@ -213,7 +212,7 @@ public class GameController {
vx
*=-
1
;
giveBonus
(
b
.
getX
()+
b
.
getWidth
()/
2
,
b
.
getY
()+
b
.
getHeight
()/
2
);
brickGroup
.
destroyBrick
(
b
);
gameModel
.
getEvents
().
addScore
(
niveau
);
gameModel
.
getEvents
().
addScore
(
difficulty
);
if
(
gameModel
.
getNbBricks
()
==
0
)
{
this
.
endGame
(
true
);
}
...
...
@@ -230,7 +229,7 @@ public class GameController {
});
gameModel
.
destroyShoot
();
brickGroup
.
destroyBrick
(
b
);
gameModel
.
getEvents
().
addScore
(
niveau
);
gameModel
.
getEvents
().
addScore
(
difficulty
);
if
(
gameModel
.
getNbBricks
()
==
0
)
{
this
.
endGame
(
true
);
}
...
...
@@ -335,16 +334,11 @@ public class GameController {
public
void
giveBonus
(
int
x
,
int
y
)
{
Random
r
=
new
Random
();
int
i
=
r
.
nextInt
(
26
);
Log
.
d
(
"Random"
,
""
+
i
);
if
(
i
==
0
)
{
int
s
=
2
;
if
(
gameModel
.
getBat2
()
!=
null
&&
y
<
gameModel
.
getGround
().
getHeight
()/
2
)
s
=
-
2
;
Log
.
d
(
"height"
,
""
+
gameModel
.
getGround
().
getHeight
());
Log
.
d
(
"y"
,
""
+
y
);
Log
.
d
(
"s"
,
""
+
s
);
gameModel
.
createBonus
(
x
,
y
,
s
);
}
}
...
...
app/src/main/java/com/example/rleger/cassebrique/Model/Evenements.java
View file @
50c283c0
...
...
@@ -14,7 +14,7 @@ public class Evenements {
this
.
score
=
score
;
}
public
void
addScore
(
int
niveau
)
{
this
.
score
+=
5
*(
niveau
+
1
);
public
void
addScore
(
int
difficulte
)
{
this
.
score
+=
5
*(
difficulte
+
1
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment