A multiplayer arena game where firing projectiles will eliminate opponents and climb you up the leaderboard.
— Attack Spheres
Attack Spheres is a real-time multiplayer game where players control attack spheres moving freely in an arena, firing projectiles at others. The objective is simple: destroy other players by hitting them with your projectiles to earn points, but beware—if you get hit, you’re out.
The game handles player connections and disconnections automatically, with disconnections triggered after a timeout period. Each player has unique attributes managed securely on the backend to prevent cheating and maintain game integrity.
The frontend uses the HTML canvas API for smooth visual rendering and real-time updates of player movements and projectiles. The backend enforces authoritative server movement, client-side prediction, server reconciliation, and player interpolation to ensure consistent, cheat-resistant gameplay.
Projectiles and collision detection are managed server-side with a "garbage collection" mechanism that removes old projectiles to keep performance optimal. The collision logic calculates distances dynamically between projectiles and players to determine hits accurately.
The game supports device pixel ratios for crisp visuals on all displays and features a dynamic leaderboard that updates as players join, showing usernames and sorting by high score in real-time.
Key Features
- - Realtime multiplayer gameplay
- - Canvas-based visuals using the HTML canvas API
- - Authoritative server movement
- - Client-side prediction for responsive control
- - Server reconciliation and interpolation for smooth movement
- - Projectile firing and real-time collision detection
- - Backend-controlled player data to prevent manipulation
- - Projectile garbage collection to maintain performance
- - Dynamic leaderboard sorted by high score
- - Device pixel ratio awareness for sharp rendering
- - Disconnection timeout to manage idle users
Important: The game is hosted on render.com’s free tier, which requires manual redeployment after 15 minutes of inactivity. To coordinate a live game session with friends or family, contact me via email or phone:
- Phone: 385-443-9375
- Email: austin.ewell86@gmail.com
Project Structure
attack-spheres/
├── backend.js
├── package.json
├── public/
│ ├── index.html
│ ├── js/
│ │ ├── classes/
│ │ │ ├── Enemy.js
│ │ │ ├── Particle.js
│ │ │ ├── Player.js
│ │ │ └── Projectile.js
│ │ ├── eventListeners.js
│ │ └── frontend.js
│ └── img/
Project Views:

Landing Screen

Username Input Screen

Random Spawn Locations

Multiple Players Joined

Leaderboard View

Dynamic Leaderboard

Firing Projectiles