- fix request game 10
Game
    - add screen and redirect when game is finish
    - fix bug with upper char
    - add own fps counter and latency counter
This commit is contained in:
Kum1ta
2024-09-29 02:06:00 +02:00
parent 217d4e27f8
commit 31a70311cc
8 changed files with 124 additions and 44 deletions

View File

@ -6,7 +6,7 @@
# By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/09/13 16:20:58 by tomoron #+# #+# #
# Updated: 2024/09/28 19:34:44 by tomoron ### ########.fr #
# Updated: 2024/09/29 02:03:40 by edbernar ### ########.fr #
# #
# **************************************************************************** #
@ -180,8 +180,8 @@ class Game:
def endGame(self, winner):
if(self.end):
return
self.p1.sync_send({"action":"game","content":{"action":10,"won":winner==1}})
self.p2.sync_send({"action":"game","content":{"action":10,"won":winner==2}})
self.p1.sync_send({"type":"game","content":{"action":10,"won":winner==1}})
self.p2.sync_send({"type":"game","content":{"action":10,"won":winner==2}})
self.winner = winner
self.end = True

View File

@ -1,6 +1,12 @@
<div class="pingDiv">
<p id="fps">0 fps</p>
<p id="ping">0 ms</p>
</div>
<div id="endGameDiv">
<p id="endGameText">You lose...</p>
<p id="endGameScore">0 - 0</p>
<p id="endGameSimpleText">You will be redirected to the lobby in 5 seconds</p>
</div>
<div class="gamePad">
<div id="fullscreen" style="background-image: url('/static/img/multiOnlineGamePage/fullscreen.png');"></div>
<div class="gamePadLeft">
@ -13,4 +19,6 @@
</div>
</div>
<!-- <img src="/static/img/multiOnlineGamePage/left-arrow.png"> -->