Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ISN 2022-ACL project Cyberpac 2077
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
RICHARD Florian
ISN 2022-ACL project Cyberpac 2077
Commits
58c0a196
Commit
58c0a196
authored
2 years ago
by
Azurlors
Browse files
Options
Downloads
Patches
Plain Diff
Raloum
parent
eaacfe7c
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
MAVENProject/src/main/java/jeu/Jeu.java
+4
-0
4 additions, 0 deletions
MAVENProject/src/main/java/jeu/Jeu.java
MAVENProject/src/main/java/jeu/Painter.java
+5
-6
5 additions, 6 deletions
MAVENProject/src/main/java/jeu/Painter.java
with
9 additions
and
6 deletions
MAVENProject/src/main/java/jeu/Jeu.java
+
4
−
0
View file @
58c0a196
...
...
@@ -12,6 +12,8 @@ import java.util.Map;
import
entity.Character
;
import
engine.Game
;
import
environnement.Coordonnees
;
import
environnement.HitBox
;
import
environnement.Obstacle
;
import
loaders.CharacterLoader
;
...
...
@@ -30,6 +32,8 @@ public class Jeu implements Game{
int
nbBeforeFramechgt
=
nbIterationPerFrame
;
//private boolean characterNotMoving = true;
private
boolean
characterAttacking
=
false
;
//boolean necessaire pour rendre l'animation d'attaque prioritaire
public
static
Obstacle
sol
=
new
Obstacle
(
new
HitBox
(
new
Coordonnees
(
200
,
700
),
1
,
1000000
));
public
Jeu
(
String
source
)
{
...
...
This diff is collapsed.
Click to expand it.
MAVENProject/src/main/java/jeu/Painter.java
+
5
−
6
View file @
58c0a196
...
...
@@ -11,9 +11,8 @@ import java.awt.image.BufferedImage;
import
java.util.HashMap
;
import
static
environnement
.
HitBox
.
collision
;
import
static
jeu
.
Jeu
.
gameCharacter
;
import
static
jeu
.
Jeu
.
gameCharacterLoader
;
import
static
jeu
.
Jeu
.
getCoordSol
;
import
static
jeu
.
Jeu
.*;
public
class
Painter
implements
GamePainter
{
...
...
@@ -30,8 +29,8 @@ public class Painter implements GamePainter{
public
void
draw
(
BufferedImage
im
)
{
Graphics2D
crayon
=
(
Graphics2D
)
im
.
getGraphics
();
crayon
.
setColor
(
Color
.
blue
);
drawCharacter
(
crayon
,
gameCharacter
,
gameCharacterLoader
.
getImageCharacter
());
draw
Sol
(
crayon
);
drawCharacter
(
crayon
,
gameCharacterLoader
.
getImageCharacter
());
draw
Obstacle
(
crayon
,
sol
);
if
(!
collision
(
gameCharacter
.
getHitBox
(),
test
.
getHitbox
())){
crayon
.
setColor
(
Color
.
blue
);
}
...
...
@@ -53,7 +52,7 @@ public class Painter implements GamePainter{
return
HEIGHT
;
}
private
void
drawCharacter
(
Graphics2D
crayon
,
Character
charac
,
Image
imageCharac
){
private
void
drawCharacter
(
Graphics2D
crayon
,
Image
imageCharac
){
int
x
=
(
int
)
gameCharacter
.
getCoord
().
getX
();
int
y
=
(
int
)
gameCharacter
.
getCoord
().
getZ
();
//crayon.fillRect(x-15,y-30, (int) gameCharacter.getEntityWIDTH(),(int) gameCharacter.getEntityHEIGHT());
...
...
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