feat(web): enable browser-based gameplay via JPro and Render deployment (#127)
โ PR Checklist
- [x] My PR title follows the format:
type(scope): description (#issue)(scope and #issue optional) - [ ] I used the correct
type: feat, fix, refactor, docs, test, chore - [x] I reviewed my code and removed unnecessary debug logs or comments.
- [x] I tested my changes and verified they work as expected.
- [x] I ran the project to confirm it compiles and runs correctly.
- [x] I read the Code of Conduct and the Contribution Guidelines.
๐ What does this PR do?
- Added a
Dockerfile(multi-stage build) to compile and run the game via JPro on Render, making it playable in the browser - Added
run-game.batconvenience script to launch the game locally in desktop or browser mode - Added
ImageCacheutility class to avoid reloading PNG images on every menu/game session, preventingOutOfMemoryErroron low-memory environments - Updated
MenuHelper,LifeComponent,ScoreComponent,BombComponentandCollectedCoinsComponentto useImageCache - Compressed heavy PNG textures with
pngquant(60โ80% quality), reducing total texture size by ~65% on average - Fixed double FXGL initialization (
IllegalArgumentException: Action already exists: Screenshot) by makingDinosaurWebApp.fxglRootstatic - Fixed JPro port binding by injecting
-Dhttp.host=0.0.0.0intovmoptionsat runtime so Render detects the open port
๐ Related Issue
- [x] This PR fixes/closes: #127
๐ธ Screenshots / Demos
๐ Live demo: https://dinosaur-exploder-d70e.onrender.com/ (if it doesn't work, its because of the free plan used on Render...) (Im leaving some screenshots to proove the functioning)
โ ๏ธ Performance note: The game is functional but runs slowly on Render's free tier due to limited CPU and RAM (512 MB). This is purely an infrastructure constraint โ upgrading to a paid plan would resolve it entirely. If this hosting solution is not considered satisfactory long-term, alternative platforms (fly.io, Railway, self-hosted VPS) could be evaluated in a future iteration. This PR represents a solid first working version.
โ All changes are fully backward compatible โ
mvn javafx:runworks exactly as before.
๐ฌ Extra Notes
[!NOTE] ๐ This contribution was made as part of a school assignment focused on open-source collaboration. I'm a student learning real-world development workflows โ this was a great challenge and I really enjoyed working on it! I'd appreciate any feedback the maintainers have. Thanks for building such a welcoming project! ๐ฆ
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
| Project | Deployment | Actions | Updated (UTC) |
|---|---|---|---|
| dinosaur-exploder | Preview | May 7, 2026 2:41am |
โ Code Formatting Check Passed!
Great job! ๐ Your code follows the Google Java Style Guide.
๐ค The DinoBot Team ๐ฆ
Build preview ๐
Thanks for your contribution to this open-source project! โค๏ธ
A new build has been generated for this pull request:
- ๐ฎ Game Artifacts: ๐ง Linux / ๐ macOS / ๐ช Windows
- ๐งช Workflow Run: View Logs
- ๐ Commit:
c5e618418aeb69d2ccd6a9e707f64d845550deb2
[!TIP] This JAR lets you test the latest version of the game from this PR.
โณ Note: Artifacts auto-expire after ~90 days.
Happy testing & enjoy the game! ๐ฎ
The DinoBot Team ๐ฆ
Quality Gate passed
Issues
4 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Performance note: The game is functional but runs slowly on Render's free tier due to limited CPU and RAM (512 MB). This is purely an infrastructure constraint โ upgrading to a paid plan would resolve it entirely. If this hosting solution is not considered satisfactory long-term, alternative platforms (fly.io, Railway, self-hosted VPS) could be evaluated in a future iteration. This PR represents a solid first working version.
Ah yes as you said, it could solve the issue yes, I could give it a try indeed !
๐ This contribution was made as part of a school assignment focused on open-source collaboration. I'm a student learning real-world development workflows โ this was a great challenge and I really enjoyed working on it! I'd appreciate any feedback the maintainers have. Thanks for building such a welcoming project! ๐ฆ
Thanks so much for this feedback, I really appreciate it!!
thanks for your reply!!
I know the version I made is really basic ๐ , but I wanted to share this solution with you because I thought it was a good starting point.
Regarding the error, I think it popped up because I was recently working on the mobile deployment:
Also, I apologize if it sounded like I was suggesting a paid Render plan! That wasn't my intention at all; I just wanted to share it as a hosting option.
If you liked this first try, I can look for a better web hosting option for the game (with music and no crashes ๐). Just let me know
Hey @fmicelii
Yes maybe let's have a look for a good hosting with music working ๐
And how did you do on mobile to make it work ? Can you give me the steps please ? So I can have a look, thanks a lot
Hey!
Thanks for the support! its new for me this whole world of contributing you know ๐
Im going to search which kind of hosting service can let us play the music. I will report my progress to you.
Talking about the mobile hosting, it wasn't complicated at all. I just had to host the game on Render and it worked on mobile. I do not remember doing any change for the mobile version...
Again, thanks a lot for the support and answering my comments this days! I didn't receive a response in many open source projects...
Im going to search which kind of hosting service can let us play the music. I will report my progress to you.
Okay awesome, thanks a lot!!
Talking about the mobile hosting, it wasn't complicated at all. I just had to host the game on Render and it worked on mobile. I do not remember doing any change for the mobile version...
AHHHH yes okay you just went on the google web page okay, makes sense. I asked because there is also a way to run the app like an Android application, that's why :)
Again, thanks a lot for the support and answering my comments this days! I didn't receive a response in many open source projects...
Thanks a lot, it's a real pleasure!!
Hello @jvondermarck , Im so sorry for the late inactivity Ive been having on the issue!!! The school is killing me and I dont have much free time to do the things I like. I wanted to tell you the reason why I didn't do anything in the last month
Hey @fmicelii,
Ahahah yes don't worry; I know the struggle, I've been through it as well. Which year are you? Anyway, don't worry at all, no stress and focus on your exams and classes and then we will keep in touch :)
Many good luck mate!
helloo @jvondermarck im in my last year of highschool. Im in a technical one sooo its very demanding for me. Its a lot of time that I have to dedicate to it if I want good grades. Thaks for the comprehension!!!
Hey, yes I can understand that it can be very demanding, many good luck again @fmicelii