Hacker News new | ask | show | jobs
by faitswulff 3082 days ago
/u/jaredly, thanks for posting, this is really exciting! I've been reading about Reason here and there, and I've always wanted to write a simple game.

At the app/game level, is there any platform-specific code? Or is it all in src? And to clarify, the big news here is cutting down on the yak-shaving with the cross-compilers and build systems right? Does it enforce any conventions on the code? Did you use any frameworks to create the game itself?

2 comments

I'll reply for Jared since he doesn't seem around. I work on Reason.

It's a single codebase and build system. There's platform-specific code buried in some conditional compilation in the Reprocessing drawing lib he uses: https://github.com/Schmavery/reprocessing

Here's a livestream of the Reprocessing folks making a flappy bird clone (https://github.com/schmavery/flappybird) from scratch: https://www.youtube.com/watch?v=5aD3aPvNpyQ&feature=youtu.be...

In the game, the only place I check the platform is to see how big I should make the screen (like 3 lines). Everything else is shared! The big news here is that you can use a single codebase (and a nice advanced language like ocaml), and deploy to 4 platforms. The framework I'm using is called "reprocessing", which is a ~port of the "processing" language to OCaml, targetting OpenGL. It abstracts out the different platforms.
I guess the Linux port wouldn't be a big thing, but what about Windows?
We are actively working on it. Linux's well on its way and is much easier than windows. We're open to PRs ;)

We consolidated web and native desktop in one repo https://github.com/bsansouci/reasongl. iOS and android are still out because we're still figuring how everything should fit together to be useful.