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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
2024-projet-agile-de-rentree
groupe-6
Commits
6e61bbdf
Commit
6e61bbdf
authored
8 months ago
by
Charlie Darques
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin'
parents
9f54102f
8420a891
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/bitFight/Character.java
+3
-0
3 additions, 0 deletions
src/main/java/bitFight/Character.java
src/main/java/bitFight/Level.java
+22
-8
22 additions, 8 deletions
src/main/java/bitFight/Level.java
with
25 additions
and
8 deletions
src/main/java/bitFight/Character.java
+
3
−
0
View file @
6e61bbdf
...
...
@@ -94,5 +94,8 @@ public class Character implements Serializable {
public
boolean
isExhausted
(){
return
this
.
currentEnergy
<=
0
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/bitFight/Level.java
+
22
−
8
View file @
6e61bbdf
...
...
@@ -72,16 +72,30 @@ public class Level{
Display
.
goToUserInput
();
}
// affiche la jauge de vie de l'ennemi
public
String
displayEnnemyHealth
()
{
return
this
.
ennemy
.
toString
()
+
" - "
+
(
int
)
this
.
ennemy
.
getCurrentHealth
()
+
"/"
+
(
int
)
this
.
ennemy
.
getMaxHealth
();
// affiche la jauge de vie
public
void
displayLifePoints
(){
System
.
err
.
println
();
System
.
out
.
println
(
"\t \t "
+
this
.
player
.
getName
());
System
.
out
.
print
(
Terminal
.
GREEN
+
" \t current health "
+
Terminal
.
RESET
);
for
(
int
indice
=
0
;
indice
<
((
this
.
player
.
getCurrentHealth
()/
this
.
player
.
getMaxHealth
())*
100
)/
2
;
indice
++){
System
.
out
.
print
(
Terminal
.
GREEN
+
"▬"
+
Terminal
.
RESET
);
}
System
.
out
.
print
(
" "
);
System
.
err
.
println
(
(
int
)
this
.
player
.
getCurrentHealth
()
+
"/"
+
(
int
)
this
.
player
.
getMaxHealth
());
System
.
out
.
print
(
Terminal
.
YELLOW
+
"\t current energy "
+
Terminal
.
RESET
);
for
(
int
indice
=
0
;
indice
<
(
this
.
player
.
getCurrentEnergy
())/
2
;
indice
++){
System
.
out
.
print
(
Terminal
.
YELLOW
+
"▬"
+
Terminal
.
RESET
);
}
System
.
out
.
print
(
" "
);
System
.
err
.
println
(
this
.
player
.
getCurrentEnergy
()
+
"/"
+
this
.
player
.
getMaxEnergy
());
}
// affiche la jauge de vie du joueur
public
String
displayPlayerHealth
()
{
return
(
int
)
this
.
player
.
getCurrentHealth
()
+
"/"
+
(
int
)
this
.
player
.
getMaxHealth
();
public
String
displayPlayerHealth
(){
return
(
int
)
this
.
ennemy
.
getCurrentHealth
()
+
" / "
+
(
int
)
this
.
ennemy
.
getMaxHealth
();
}
// annonce la mort de l'ennemi
public
void
ennemyDying
()
{
System
.
out
.
println
(
"The ennemy is dead!"
);
...
...
@@ -217,5 +231,5 @@ public class Level{
}
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