Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MoteurDeJeu
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
Villard PierreFrederic
MoteurDeJeu
Commits
ebb4f677
Commit
ebb4f677
authored
3 years ago
by
Villard PierreFrederic
Browse files
Options
Downloads
Patches
Plain Diff
Activate or not the subjective view
parent
bd687c80
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
src/afficheur/Repere.java
+15
-6
15 additions, 6 deletions
src/afficheur/Repere.java
test/testMario.java
+3
-0
3 additions, 0 deletions
test/testMario.java
with
18 additions
and
6 deletions
src/afficheur/Repere.java
+
15
−
6
View file @
ebb4f677
...
...
@@ -21,6 +21,8 @@ import physique.ObjetHeros;
public
class
Repere
{
public
static
boolean
isSubjective
=
true
;
//besoin d'un lien vers le heros
//vue subjective
...
...
@@ -39,12 +41,19 @@ public class Repere {
*/
public
static
int
[]
changeRepere
(
Objet
o
)
{
int
res
[]=
new
int
[
4
];
res
[
0
]=
100
+
(
int
)
o
.
px
-
(
int
)
h
.
px
;
res
[
1
]=
370
-
(
int
)
o
.
py
-
(
int
)(
o
.
height
);
res
[
2
]=
(
int
)
o
.
width
;
res
[
3
]=
(
int
)
o
.
height
;
return
(
res
);
int
res
[]=
new
int
[
4
];
res
[
1
]=
370
-
(
int
)
o
.
py
-
(
int
)(
o
.
height
);
res
[
2
]=
(
int
)
o
.
width
;
res
[
3
]=
(
int
)
o
.
height
;
if
(
isSubjective
)
{
res
[
0
]=
100
+
(
int
)
o
.
px
-
(
int
)
h
.
px
;
}
else
{
res
[
0
]=
(
int
)
o
.
px
;
}
return
(
res
);
}
}
This diff is collapsed.
Click to expand it.
test/testMario.java
+
3
−
0
View file @
ebb4f677
...
...
@@ -16,6 +16,7 @@
import
miscellaneous.MurCool
;
import
afficheur.Afficheur
;
import
afficheur.Repere
;
import
controle.ControleurClavier
;
import
physique.Monde
;
import
physique.MoteurPhysique
;
...
...
@@ -95,6 +96,8 @@ public class testMario {
maBoucle
.
jeuPhysique
.
moteurPhys
=
moteurPhys
;
// Change l'image de fond
affiche
.
decor
.
changeImage
(
"background2.jpg"
);
// Passage à une vue non subjective
Repere
.
isSubjective
=
true
;
// Test to change the image
//monMonde.balle.sprites.assignNewImage("hero2.png");
...
...
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