Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sae-2023-groupeH-Bouin-Belguebli-Decoster
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
Julien Bouin
sae-2023-groupeH-Bouin-Belguebli-Decoster
Commits
95ffe59d
Commit
95ffe59d
authored
1 year ago
by
Mathis Decoster
Browse files
Options
Downloads
Patches
Plain Diff
details
parent
89e7e2e8
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
client/src/main.js
+4
-2
4 additions, 2 deletions
client/src/main.js
server/index.js
+1
-3
1 addition, 3 deletions
server/index.js
with
5 additions
and
5 deletions
client/src/main.js
+
4
−
2
View file @
95ffe59d
...
...
@@ -14,7 +14,7 @@ let gameStarted = false;
const
canvas
=
document
.
querySelector
(
'
.gameCanvas
'
);
const
context
=
canvas
.
getContext
(
'
2d
'
);
const
avatar
=
new
Avatar
(
'
julien
'
,
1
);
const
avatar
=
new
Avatar
(
'
1
'
,
1
);
renderObject
.
imageMortier
.
addEventListener
(
'
load
'
,
()
=>
{
avatar
.
setImageCanvas
(
renderObject
.
imageMortier
,
canvas
);
...
...
@@ -79,7 +79,6 @@ function render() {
context
.
clearRect
(
0
,
0
,
canvas
.
width
,
canvas
.
height
);
renderObject
.
renderBackground
(
canvas
);
gameStarted
=
affichage
.
isGameStarted
();
console
.
log
(
gameStarted
);
if
(
gameStarted
)
{
context
.
font
=
'
40pt New Super Mario Font U
'
;
for
(
let
i
=
1
;
i
<
avatars
.
length
;
i
++
)
{
...
...
@@ -135,6 +134,9 @@ function render() {
let
avatars
=
[];
socket
.
on
(
'
disconnectEvent
'
,
id
=>
{
if
(
avatar
.
getNom
()
==
id
)
{
affichage
.
afficherFinDePartie
();
}
avatars
[
id
]
=
{};
});
...
...
This diff is collapsed.
Click to expand it.
server/index.js
+
1
−
3
View file @
95ffe59d
...
...
@@ -70,7 +70,6 @@ io.on('connection', socket => {
});
socket
.
on
(
'
start
'
,
s
=>
{
console
.
log
(
s
);
if
(
s
==
true
&&
cpt
!=
0
)
{
gameStarted
=
s
;
}
else
if
(
cpt
==
0
)
{
...
...
@@ -184,9 +183,8 @@ setInterval(() => {
},
100
);
}
if
(
avatar
.
getVies
()
==
0
)
{
//afficherFinDePartie();
avatar
.
initAvatar
();
//
t = new timer();
//
TODO : afficher écran fin de partie de l'avatar concerné
}
}
if
(
enemi
.
getVies
()
<
0
)
{
...
...
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