feat: stats + chat + frontend pages (Stats, Chat, NavBar)
Backend: - StatsManager.js: JSON persistence, leaderboard, rate-limit 1/5s - ChatManager.js: 200-msg buffer, JSON persistence - index.js: routes GET/POST /stats, /chat/history, /chat/send (Zod validation) - ArenaRoom.js: chat handler broadcasts to room + persists via ChatManager Unity: - StatsTracker.cs: distance, maxSpeed, jumps, bumps, checkpoints, raceTime tracking - ChatUI.cs: F3 toggle, bottom-right panel, polling 3s, unread badge - NetworkManager.cs: SendChatMessage() + OnMessage<ChatUI.ChatMessage>(chat) - CheckpointSystem.cs: RegisterCheckpoint/Finish hooks - PlayerController.cs: RegisterJump/Bump hooks, physics rebalance, billboard fix - GameHUD.cs: LocalRaceTimer, SetTotalRounds, OnRoundStart signature fix - GameManager.cs: spectator cam reconnect fix Frontend: - NavBar.jsx: fixed top nav, Accueil/Stats/Chat/Jouer - App.jsx: page state (home/play/stats/chat) + NavBar - StatsPage.jsx: 6-tab leaderboard, auto-refresh 30s - ChatPage.jsx: polling 3s, localStorage name, Enter to send Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -376,9 +376,9 @@ public class PlayerController : MonoBehaviour
|
||||
{
|
||||
if (context.started)
|
||||
{
|
||||
// Touche appuyée
|
||||
isJumpPressed = true;
|
||||
jumpPressTime = 0f;
|
||||
StatsTracker.Instance?.RegisterJump();
|
||||
Debug.Log("Jump Started");
|
||||
}
|
||||
else if (context.performed)
|
||||
@@ -516,6 +516,7 @@ public class PlayerController : MonoBehaviour
|
||||
return;
|
||||
|
||||
_lastBumpTime[id] = Time.time;
|
||||
StatsTracker.Instance?.RegisterBump();
|
||||
|
||||
// Repulsion direction: from remote toward local player
|
||||
Vector3 dir = (transform.position - other.transform.position).normalized;
|
||||
@@ -606,6 +607,13 @@ public class PlayerController : MonoBehaviour
|
||||
fontStyle = FontStyle.Bold
|
||||
};
|
||||
labelStyle.normal.textColor = new Color(1f, 1f, 1f, _gaugeDisplayAlpha * 0.9f);
|
||||
// Outline: draw 4× in black at ±1px, then once in white
|
||||
var shadowStyle = new GUIStyle(labelStyle);
|
||||
shadowStyle.normal.textColor = new Color(0f, 0f, 0f, _gaugeDisplayAlpha * 0.55f);
|
||||
GUI.Label(new Rect(x + 1f, y - 25f, barWidth, 24f), "JUMP POWER", shadowStyle);
|
||||
GUI.Label(new Rect(x - 1f, y - 27f, barWidth, 24f), "JUMP POWER", shadowStyle);
|
||||
GUI.Label(new Rect(x + 1f, y - 27f, barWidth, 24f), "JUMP POWER", shadowStyle);
|
||||
GUI.Label(new Rect(x - 1f, y - 25f, barWidth, 24f), "JUMP POWER", shadowStyle);
|
||||
GUI.Label(new Rect(x, y - 26f, barWidth, 24f), "JUMP POWER", labelStyle);
|
||||
|
||||
// Ensure textures
|
||||
|
||||
Reference in New Issue
Block a user