
PLAY HERE: https://spong-fu.dev/
PRESS SPACEBAR
TO WIN
STAR OUR REPO ;)
It's simple fast-paced In-Browser MULTIPLAYER game born from chaos and too much black coffee.
It’s fast, ridiculous, and deceptively skill-based.
-
One Button, No Mercy: You’ve got a single button. That’s it. Press it to launch your sponge. The catch? Your aim spins wildly, so timing is everything. Miss it—and you’re flying somewhere very unplanned.
-
Grow Big or Die Fast: Stay still and your sponge swells with power. Bigger sponge = stronger launch. But wait too long... and someone might send you flying first.
-
Bumper Battle Royale: Slam into other players to knock them off the platform. Last sponge standing wins. Simple? Yes. Calm? Absolutely not.
-
The Floor is a Lie: After 5 seconds of madness, the platform begins to shrink. Fast. Hope you aimed well.
Oh—and it all runs in your browser. No downloads. Just instant, synchronized chaos powered by a server that keeps things fair (even if nothing feels fair).
If you have docker - then:
docker run pmackiewicz6/spongout-image:latest
And go to http://localhost:8080
If not then:
Java 21
- Clone repo
cd
to dir./mvnw spring-boot:run
- And go to
http://localhost:8080
Heart of this game is written in... JAVA w/ Spring-Boot <3 We got dependencies injections and more than 20 classes! Could be more, but didn't have time for that much CLEAN CODE :D For communication Client <-> Server we used WebSockets w/ STOMP protocol over it.
- Player goes to https://spong-fu.dev/
- Types nickname
- this request goes to
GameLobbyService
(throughGameController
) - In this place, we create
GameInstance
from gathered players (2-5 players for each game) - And throw them right into
GameExecutionService
and this is the moment when GAME STARTS! - Here we store all currently played GameInstances and making them alive! Their
GameState
is updating 60x/s and it's sended to all subscribers (players) - In every
tick()
GameInstance
goes fromGameExecutionService
toGameEngine
for players positions updates & colissions checking. This is also the place where we get our players moving! - In every
tick()
we also check if someone was eliminated or game ended and we got a winner already. All this infos are sent to players via WebSockets to keep them updated. - If only one players is left - then we got a WINNER and GAME is finished!
The Frontend is written in... Plain JavaScript We are using P5.js library for our canva and game design, and it's definitely not clean code frontend is also messy as hell, hope that's not a problem And as written in Backend, we are using STOMP for our socket connections
- Lobby & Connection: We connect to the socket with
initNetworking
and wait for the user to enter a nickname and click "Join Game". Clicking "Join Game" you'll create a lobby/ gameId. - Game Start: Now you wait, when someone else clicks join game, they join your lobby, now you can play with just the 2 of you or wait for others.
- Player Input: You hit SPACEBAR to move which triggers the
keyPressed()
function. - Rendering: From the socket connection we receive coordinates in real time from
onPrivateMessage()
and that gives us all the updated states and we draw those states using p5.js. - Elimination and Victory: These are also handled through
onPrivateMessage()
, and theFloatingText
class. - My first time writing a readme, so if it's not alright pls understand :)
