@vite(['resources/css/tutorial.css', 'resources/js/tutorial/main.js'])

Game Arena

Play, learn, and conquer the leaderboards!

@if($userStats) @php $score = $userStats['total_score']; // Determine Rank Title and CSS Class $rankData = match(true) { $score >= 5000 => ['title' => 'Grandmaster', 'class' => 'rank-grandmaster'], $score >= 2500 => ['title' => 'Expert', 'class' => 'rank-expert'], $score >= 1000 => ['title' => 'ProPlayer', 'class' => 'rank-proplayer'], $score >= 500 => ['title' => 'Challenger', 'class' => 'rank-challenger'], default => ['title' => 'Rookie', 'class' => 'rank-rookie'], }; // Rank Icon Map $rankIcons = [ 'Grandmaster' => '🏆', 'Expert' => '💎', 'ProPlayer' => '🌟', 'Challenger' => '⚔️', 'Rookie' => '🌱' ]; $userCursor = $rankIcons[$rankData['title']] ?? '🌱'; // Rank Upgrade Detection - Check if user has upgraded to a new rank $rankMinScores = [ 'Grandmaster' => 5000, 'Expert' => 2500, 'ProPlayer' => 1000, 'Challenger' => 500, 'Rookie' => 0 ]; $previousRankName = session('user_game_rank'); $currentRankName = $rankData['title']; $rankUpgraded = false; $previousRankData = null; // Only trigger upgrade if we have both previous and current rank and they're different if ($previousRankName && $currentRankName && $previousRankName !== $currentRankName) { // Find previous rank data for the modal $previousRankMinScore = $rankMinScores[$previousRankName] ?? 0; $currentRankMinScore = $rankMinScores[$currentRankName] ?? 0; // Only show upgrade if moving UP (higher min score = higher rank) if ($currentRankMinScore > $previousRankMinScore) { $rankUpgraded = true; $previousRankData = [ 'title' => $previousRankName, 'icon' => $rankIcons[$previousRankName] ?? '🌱' ]; } } // Always update session with current rank session(['user_game_rank' => $currentRankName]); @endphp

Total Score

{{ number_format($score) }}
{{ $userStats['games_played'] }} games played
@php $rankIcons = [ 'Grandmaster' => '🏆', 'Expert' => '💎', 'ProPlayer' => '🌟', 'Challenger' => '⚔️', 'Rookie' => '🌱' ]; $title = $rankData['title'] ?? 'Rookie'; $currentIcon = $rankIcons[$title] ?? '🌱'; @endphp
{{ $currentIcon }}
🎮
@endif
🏆

Top Players

@if(Auth::check() && $userRank)
#{{ $userRank }}
@endif
⏰ Resets every Monday at 1:00 PM
@forelse($leaderboard as $index => $player) @php $rankClass = match($index) { 0 => 'gold', 1 => 'silver', 2 => 'bronze', default => 'normal' }; $isCurrentUser = Auth::check() && Auth::id() === $player->id; @endphp
{{ $index + 1 }}
@php $avatarUrl = $player->profile_picture ? asset('uploads/profiles/' . $player->profile_picture) : 'https://ui-avatars.com/api/?name=' . urlencode($player->name) . '&background=7c3aed&color=fff&size=64'; $fallbackUrl = 'https://ui-avatars.com/api/?name=' . urlencode($player->name) . '&background=7c3aed&color=fff&size=64'; @endphp {{ $player->name }}
{{ $player->name }}
{{ number_format($player->total_score) }} pts
@empty

No players yet. Be the first!

@endforelse

Featured Games

Play, Learn & Win

🔤
⭐ +10 pts/word

Word Scramble

Unscramble the letters to form the correct word. Test your vocabulary!

Play Now
🃏
⭐ +5 pts/pair

Flashcard Match

Match words with their meanings in this memory game. Train your brain!

Play Now
⚡
⭐ +15 pts/correct

Speed Quiz

Answer vocabulary questions as fast as you can. Beat the clock!

Play Now
⌨️
⭐ +5 pts/word

Typing Race

Type the words as fast as you can! Improve your speed and accuracy.

Play Now
@if(Auth::check() && Auth::user()->is_admin)
INITIATING EVIL PROTOCOL
💀
[ ACCESSING EVIL DOMAIN... ]
01001000 01000001 01000011 01001011
@endif
👋

Leaving so soon?

Are you sure you want to logout from PolyLearn?

🎮

Game Ranks

Your rank is based on your total game score

@php $currentScore = $userStats['total_score'] ?? 0; $ranks = [ ['min' => 5000, 'name' => 'Grandmaster', 'icon' => '🏆', 'color' => '#fbbf24'], ['min' => 2500, 'name' => 'Expert', 'icon' => '💎', 'color' => '#22d3ee'], ['min' => 1000, 'name' => 'ProPlayer', 'icon' => '🌟', 'color' => '#a855f7'], ['min' => 500, 'name' => 'Challenger', 'icon' => '⚔️', 'color' => '#f97316'], ['min' => 0, 'name' => 'Rookie', 'icon' => '🌱', 'color' => '#22c55e'], ]; // Find current rank $currentRankIndex = count($ranks) - 1; foreach ($ranks as $idx => $rank) { if ($currentScore >= $rank['min']) { $currentRankIndex = $idx; break; } } @endphp @foreach($ranks as $idx => $rank) @php $isCurrent = $idx === $currentRankIndex; $isAchieved = $currentScore >= $rank['min']; $rankClass = 'rank-' . strtolower($rank['name']); @endphp
{{ $rank['icon'] }}
{{ $rank['name'] }} @if($isCurrent) YOUR RANK @endif
@if($rank['min'] > 0) {{ number_format($rank['min']) }}+ points required @else Starting rank @endif
@if($isAchieved) ✓ @else 🔒 @endif
@endforeach
@if(isset($rankUpgraded) && $rankUpgraded && isset($rankData) && isset($previousRankData))
🎮
{{ $previousRankData['icon'] }}
{{ $previousRankData['title'] }}
{{ $rankIcons[$rankData['title']] ?? '🌱' }}
{{ $rankData['title'] }}

Rank Up!

You've reached a new game rank!

Keep playing to climb even higher on the leaderboard!

@endif