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
4190a0d7
Commit
4190a0d7
authored
8 months ago
by
Kellian Mirey
Browse files
Options
Downloads
Patches
Plain Diff
Patch healthbar
parent
fad0fc7b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/main/java/bitFight/Display.java
+6
-0
6 additions, 0 deletions
src/main/java/bitFight/Display.java
src/main/java/bitFight/Level.java
+2
-2
2 additions, 2 deletions
src/main/java/bitFight/Level.java
src/main/java/bitFight/Main.java
+5
-0
5 additions, 0 deletions
src/main/java/bitFight/Main.java
with
13 additions
and
2 deletions
src/main/java/bitFight/Display.java
+
6
−
0
View file @
4190a0d7
...
@@ -70,4 +70,10 @@ public class Display {
...
@@ -70,4 +70,10 @@ public class Display {
System
.
out
.
println
(
text
);
System
.
out
.
println
(
text
);
goToUserInput
();
goToUserInput
();
}
}
public
static
void
displayNewHealthBar
(){
setCursorPos
(
row
,
0
);
level
.
displayLifePoints
();
goToUserInput
();
}
}
}
This diff is collapsed.
Click to expand it.
src/main/java/bitFight/Level.java
+
2
−
2
View file @
4190a0d7
...
@@ -89,7 +89,7 @@ public class Level{
...
@@ -89,7 +89,7 @@ public class Level{
}
}
}
}
System
.
out
.
print
(
" "
);
System
.
out
.
print
(
" "
);
System
.
err
.
println
(
(
int
)
this
.
player
.
getCurrentHealth
()
+
"/"
+
(
int
)
this
.
player
.
getMaxHealth
());
System
.
err
.
println
(
(
int
)
this
.
player
.
getCurrentHealth
()
+
"/"
+
(
int
)
this
.
player
.
getMaxHealth
()
+
" "
);
System
.
out
.
print
(
Terminal
.
YELLOW
+
"\t current energy "
+
Terminal
.
RESET
);
System
.
out
.
print
(
Terminal
.
YELLOW
+
"\t current energy "
+
Terminal
.
RESET
);
for
(
int
indice
=
0
;
indice
<
(
this
.
player
.
getCurrentEnergy
())/
2
;
indice
++){
for
(
int
indice
=
0
;
indice
<
(
this
.
player
.
getCurrentEnergy
())/
2
;
indice
++){
System
.
out
.
print
(
Terminal
.
YELLOW
+
"▬"
+
Terminal
.
RESET
);
System
.
out
.
print
(
Terminal
.
YELLOW
+
"▬"
+
Terminal
.
RESET
);
...
@@ -100,7 +100,7 @@ public class Level{
...
@@ -100,7 +100,7 @@ public class Level{
public
String
displayPlayerHealth
(){
public
String
displayPlayerHealth
(){
return
(
int
)
this
.
ennemy
.
getCurrentHealth
()
+
" / "
+
(
int
)
this
.
ennemy
.
getMaxHealth
();
return
(
int
)
this
.
player
.
getCurrentHealth
()
+
" / "
+
(
int
)
this
.
player
.
getMaxHealth
();
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/bitFight/Main.java
+
5
−
0
View file @
4190a0d7
...
@@ -94,6 +94,7 @@ class Main {
...
@@ -94,6 +94,7 @@ class Main {
Display
.
clearDialogBox
();
Display
.
clearDialogBox
();
Attack
randomEnemyAttack
=
Attack
.
values
()[(
int
)
rand
.
nextDouble
()*
Attack
.
values
().
length
];
Attack
randomEnemyAttack
=
Attack
.
values
()[(
int
)
rand
.
nextDouble
()*
Attack
.
values
().
length
];
level
.
ennemyFaster
(
randomEnemyAttack
);
level
.
ennemyFaster
(
randomEnemyAttack
);
Display
.
displayNewHealthBar
();
timeBeforeAttack
=
LocalDateTime
.
now
();
timeBeforeAttack
=
LocalDateTime
.
now
();
input
.
newInput
();
input
.
newInput
();
}
}
...
@@ -137,6 +138,10 @@ class Main {
...
@@ -137,6 +138,10 @@ class Main {
enemy
.
levelUp
();
enemy
.
levelUp
();
level
.
levelGoingUp
();
level
.
levelGoingUp
();
level
.
displayEndOfLevel
();
level
.
displayEndOfLevel
();
}
if
(
player
.
isDead
()){
Display
.
clearScreen
();
level
.
defeat
();
}
}
if
(
player
.
isDead
())
{
if
(
player
.
isDead
())
{
...
...
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