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
f651d446
Commit
f651d446
authored
2 years ago
by
bruno
Browse files
Options
Downloads
Patches
Plain Diff
key
parent
5dfb878e
No related branches found
No related tags found
1 merge request
!1
Key
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MAVENProject/src/main/java/entity/Character.java
+19
-9
19 additions, 9 deletions
MAVENProject/src/main/java/entity/Character.java
with
19 additions
and
9 deletions
MAVENProject/src/main/java/entity/Character.java
+
19
−
9
View file @
f651d446
...
...
@@ -13,9 +13,13 @@ import static environnement.PositionCollision.*;
import
environnement.PositionCollision
;
import
jeu.Jeu
;
import
map.Obstacle
;
import
map.Coffre
;
import
static
environnement
.
HitBox
.
collision
;
import
static
environnement
.
HitBox
.
collisionObstacle
;
import
static
jeu
.
Jeu
.
getObstacleTable
;
//import static jeu.Jeu.gameCharacter;
import
static
jeu
.
Jeu
.
getCoffreTable
;
public
class
Character
extends
Entity
{
...
...
@@ -23,7 +27,7 @@ public class Character extends Entity{
private
double
vitesseActuZ
=
0
;
private
final
double
impulsionSaut
;
private
double
masse
;
p
rivate
int
clef
;
p
ublic
int
key
;
private
Map
<
String
,
Double
>
tableCommande
;
//table des commandes du perso
...
...
@@ -112,7 +116,20 @@ public class Character extends Entity{
}
}
}
public
void
keyGestion
()
{
for
(
Coffre
obs
:
Jeu
.
getCoffreTable
()){
if
(
collision
(
this
.
getHitBox
(),
obs
.
getHitbox
())){
if
(
obs
.
key
==
true
)
{
this
.
key
+=
1
;
obs
.
key
=
false
;
System
.
out
.
print
(
this
.
key
);
}
}
}
}
public
List
<
Obstacle
>
obstacleInVoisinage
(){
List
<
Obstacle
>
liste
=
new
ArrayList
<>();
for
(
Obstacle
obs
:
getObstacleTable
()){
...
...
@@ -133,14 +150,6 @@ public class Character extends Entity{
}
}
public
void
clef
(){
for
(
Coffre
coffre
:
Jeu
.
getCoffreTable
()){
if
(
HitBox
.
collision
(
this
.
hitBox
,
coffre
.
getHitBox
()){
monster
.
setNbLifePoints
(
Math
.
max
(
monster
.
getNbLifePoints
()-
attackStat
,
0
));
}
}
}
public
void
getGameCommand
(){
Map
<
String
,
Boolean
>
commandeJeu
=
Jeu
.
getDirectionJeu
();
...
...
@@ -171,6 +180,7 @@ public class Character extends Entity{
deplacements
();
attaque
();
collisionGestion
();
keyGestion
();
updateVoisinage
();
this
.
setHitBox
(
new
HitBox
(
this
.
getCoord
(),
entityHEIGHT
,
entityWIDTH
));
// mise à jour moins crade pour l'instant
resetCommand
();
...
...
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