Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
groupe-6
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
2024-projet-agile-de-rentree
groupe-6
Commits
224d7e62
Commit
224d7e62
authored
10 months ago
by
Charlie Darques
Browse files
Options
Downloads
Patches
Plain Diff
modifications level et main
parent
c69a1f63
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/sprint-7/README.md
+3
-1
3 additions, 1 deletion
doc/sprint-7/README.md
src/main/java/bitFight/Level.java
+2
-1
2 additions, 1 deletion
src/main/java/bitFight/Level.java
src/main/java/bitFight/Main.java
+3
-1
3 additions, 1 deletion
src/main/java/bitFight/Main.java
with
8 additions
and
3 deletions
doc/sprint-7/README.md
+
3
−
1
View file @
224d7e62
# Sprint 7
# Sprint 7
### Ce que nous avons fait durant ce sprint
### Ce que nous avons fait durant ce sprint
-
Correction commune d'une majorité du main
-
Ajout des caractéristiques aléatoires
-
Implémentation du score et de la sauvegarde
### Ce que nous allons faire durant le prochain sprint
### Ce que nous allons faire durant le prochain sprint
...
...
This diff is collapsed.
Click to expand it.
src/main/java/bitFight/Level.java
+
2
−
1
View file @
224d7e62
...
@@ -64,7 +64,8 @@ public class Level{
...
@@ -64,7 +64,8 @@ public class Level{
public
void
ennemyFaster
(
Attack
attack
)
{
public
void
ennemyFaster
(
Attack
attack
)
{
System
.
out
.
println
(
"The ennemy attacks before you can !"
);
System
.
out
.
println
(
"The ennemy attacks before you can !"
);
player
.
setCurrentHealth
(
player
.
getCurrentHealth
()
-
attack
.
getDamage
()
*
this
.
ennemy
.
getAttackMultiplier
());
//Récupère une attaque aléatoire dans l'enum
player
.
setCurrentHealth
(
player
.
getCurrentHealth
()
-
attack
.
getDamage
()
*
this
.
ennemy
.
getAttackMultiplier
());
//Récupère une attaque aléatoire dans l'enum
System
.
out
.
println
(
attack
.
getName
()
+
"!! You're getting "
+
attack
.
getDamage
()
*
this
.
ennemy
.
getAttackMultiplier
()
+
" damage!"
);
System
.
out
.
println
(
attack
.
getName
()
+
"!! You're getting "
+
(
int
)
attack
.
getDamage
()
*
this
.
ennemy
.
getAttackMultiplier
()
+
" of damage!"
);
System
.
out
.
println
(
this
.
player
.
getName
()
+
"'s life' : "
+
this
.
displayPlayerHealth
());
}
}
// affiche la jauge de vie de l'ennemi
// affiche la jauge de vie de l'ennemi
...
...
This diff is collapsed.
Click to expand it.
src/main/java/bitFight/Main.java
+
3
−
1
View file @
224d7e62
...
@@ -72,13 +72,15 @@ class Main {
...
@@ -72,13 +72,15 @@ class Main {
LocalDateTime
timeBeforeAttack
=
LocalDateTime
.
now
();
LocalDateTime
timeBeforeAttack
=
LocalDateTime
.
now
();
int
attackTime
=
5
-
(
int
)(
5
*
rand
.
nextDouble
());
int
attackTime
=
5
-
(
int
)(
5
*
rand
.
nextDouble
());
// arrivée de l'ennemi
level
.
ennemyShowing
();
if
(
input
.
getInput
().
equals
(
"a"
))
{
if
(
input
.
getInput
().
equals
(
"a"
))
{
level
.
possibleActions
();
level
.
possibleActions
();
input
.
newInput
(
in
.
readLine
());
input
.
newInput
(
in
.
readLine
());
// Boucle tant que le joueur n'a pas taper de nom d'une attaque valide
// Boucle tant que le joueur n'a pas taper de nom d'une attaque valide
while
(!
actionNames
.
contains
(
input
.
getInput
())
||
Attack
.
attackInTime
(
timeBeforeAttack
,
attackTime
))
{
while
(!
actionNames
.
contains
(
input
.
getInput
())
||
Attack
.
attackInTime
(
timeBeforeAttack
,
attackTime
))
{
level
.
ennemyShowing
();
//Si le joueur est trop lent, l'ennemi fait une attaque aléatoire
//Si le joueur est trop lent, l'ennemi fait une attaque aléatoire
if
(
Attack
.
attackInTime
(
timeBeforeAttack
,
attackTime
)){
if
(
Attack
.
attackInTime
(
timeBeforeAttack
,
attackTime
)){
Display
.
clearDialogBox
();
Display
.
clearDialogBox
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment