News for hackers. Stuff that matters.
Re:Building a Web Game in C by parasti on Tuesday December 12, 2023 @08:38AM (#38611886)
If you rely on common game libraries and widely supported web APIs, you can get quite far with C. Here's an OpenGL and SDL2 game running in the browser that I ported (and also maintain):

https://play.neverball.org/

Getting it to render was the easy part; I've since spent the majority of time getting it to feel native to the browser, implementing responsiveness (web dev term for adapting to viewport size), touch controls, GUI tweaks, working around fullscreen API gotchas (e.g., the Esc key/Back button is reserved), and any other small things that might remind you that this is not a native browser game.

Re:Building a Web Game in C by all2 on Tuesday December 12, 2023 @12:08PM (#38614995)
I don't think I've ever played a game where the laptop touch pad made so much sense. I think that's the most natural feeling UI I've ever used.
Re:Building a Web Game in C by swingingFlyFish on Tuesday December 12, 2023 @09:20AM (#38612397)
Dude this is really cool. Do you have a repo or other site where you talk about this?
Re:Building a Web Game in C by PennRobotics on Tuesday December 12, 2023 @10:05AM (#38613064)
Re:Building a Web Game in C by hejira on Wednesday December 13, 2023 @02:54AM (#38623982)
Great game! My four year old got hooked on it too!
Re:Building a Web Game in C by parasti on Wednesday December 13, 2023 @12:59PM (#38631362)
That's awesome!