Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ACL_M1_Info
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
AMET Matthieu
ACL_M1_Info
Commits
d1827a40
Commit
d1827a40
authored
2 years ago
by
iiztp
Browse files
Options
Downloads
Plain Diff
Merge branch 'sprint2' of
https://gitlab.univ-lorraine.fr/amet26u/acl_m1_info
into sprint2
parents
f31e1af2
df1a63e2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/src/main/java/com/dala/mapz/screens/GameScreen.java
+2
-1
2 additions, 1 deletion
core/src/main/java/com/dala/mapz/screens/GameScreen.java
core/src/main/java/com/dala/mapz/utils/Text.java
+9
-12
9 additions, 12 deletions
core/src/main/java/com/dala/mapz/utils/Text.java
with
11 additions
and
13 deletions
core/src/main/java/com/dala/mapz/screens/GameScreen.java
+
2
−
1
View file @
d1827a40
...
...
@@ -94,6 +94,7 @@ public class GameScreen implements Screen {
dy
=
-
Constants
.
PLAYER_SPEED
;
}
//Déplacement rapide du personnage (1 dash par seconde maximum)
if
(
Gdx
.
input
.
isKeyPressed
(
Input
.
Keys
.
SPACE
)){
if
(
timeSinceLastDash
>
1.0f
)
{
if
(!
dash
)
{
...
...
@@ -279,7 +280,7 @@ public class GameScreen implements Screen {
if
(
e
.
isEnemy
()){
Enemy
enemy
=
(
Enemy
)
e
;
if
(
enemy
.
getHealth
()>
0
)
{
batch
.
draw
(
healthBarEnnemy
,
enemy
.
getBody
().
getPosition
().
x
-
10
,
enemy
.
getBody
().
getPosition
().
y
+
2
,
enemy
.
getHealth
(),
1
);
batch
.
draw
(
healthBarEnnemy
,
enemy
.
getBody
().
getPosition
().
x
-
5
,
enemy
.
getBody
().
getPosition
().
y
+
2
,
enemy
.
getHealth
()
/
2
,
1
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
core/src/main/java/com/dala/mapz/utils/Text.java
+
9
−
12
View file @
d1827a40
...
...
@@ -10,7 +10,10 @@ public class Text {
private
final
BitmapFont
police1
;
private
final
BitmapFont
police2
;
public
Text
(){
//générer la police
/**
* Génère des polices.
*/
public
Text
(){
FreeTypeFontGenerator
fGen
=
new
FreeTypeFontGenerator
(
Gdx
.
files
.
internal
(
"Comic_Sans_MS_Bold.ttf"
));
FreeTypeFontGenerator
.
FreeTypeFontParameter
fParams
=
new
FreeTypeFontGenerator
.
FreeTypeFontParameter
();
fParams
.
size
=
20
;
...
...
@@ -21,23 +24,17 @@ public class Text {
police1
=
fGen
.
generateFont
(
fParams
);
police1
.
setUseIntegerPositions
(
false
);
fParams
.
size
=
130
;
fParams
.
color
=
new
Color
(
1
f
,
0
f
,
0
f
,
0.75f
);
fParams
.
borderColor
=
Color
.
BLACK
;
fParams
.
borderWidth
=
3
;
FreeTypeFontGenerator
.
FreeTypeFontParameter
fParams2
=
new
FreeTypeFontGenerator
.
FreeTypeFontParameter
();
fParams2
.
size
=
130
;
fParams2
.
color
=
new
Color
(
1
f
,
0
f
,
0
f
,
0.75f
);
fParams2
.
borderColor
=
Color
.
BLACK
;
fParams2
.
borderWidth
=
3
;
police2
=
fGen
.
generateFont
(
fParams2
);
police2
=
fGen
.
generateFont
(
fParams
);
police2
.
setUseIntegerPositions
(
false
);
fGen
.
dispose
();
}
public
void
displayText
(
SpriteBatch
spriteBatch
,
String
texte
,
float
x
,
float
y
,
int
larg
,
int
alignt
,
boolean
retLig
){
police1
.
draw
(
spriteBatch
,
texte
,
x
,
y
,
larg
,
alignt
,
retLig
);
}
public
void
gameOverText
(
SpriteBatch
spriteBatch
,
float
x
,
float
y
){
police2
.
draw
(
spriteBatch
,
"GAME OVER"
,
x
,
y
,
400
,
0
,
true
);
}
...
...
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