Live data from Hacker News

Making a cross-platform mobile game in Reason/OCaml

jaredforsyth.com

21–27 of 27 posts

Re: Making a cross-platform mobile game in Reason/OCaml

#23
post #9

/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 framewor…

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 pla…

I guess the Linux port wouldn't be a big thing, but what about Windows?

Re: Making a cross-platform mobile game in Reason/OCaml

#24

The game, Gravitron, looks very similar to an old Ludum Dare entry called Graviton: http://sam.draknek.org/projects/gravity (timelapse development video: https://www.youtube.com/watch?v=3tQ00R69rF8 ) It's a really cool game concept, even cooler being written in OCaml! :)

Not only is this game a total blast to play, but it's also one of the only games that I think is best played on a trackpad instead of with a mouse. However if I were the creator of this game, I'd be pretty pissed at the one in the OP. One was obviously inspired by the other.

Convergent evolution :) I made the version version of Gravitron in 2006

Re: Making a cross-platform mobile game in Reason/OCaml

#26
post #23
post #9

Earlier quoted context omitted.

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 pla…

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.

Re: Making a cross-platform mobile game in Reason/OCaml

#27

Very cool. Hot reloading in iOS would be extreamly useful. I remember that I used a plugin that was called injectionforxcode but it was not working very well.

I have yet to find a reason to support iOS hot reloading in this context to be perfectly honest. I use the desktop bytecode hot reloading (implemented inside Reprocessing so everyone can benefit from it), and it works wonderfully well. It's faster than anything you've seen before. And given that you probably want to be coding in Reason and not objc, it doesn't really matter what your render target is while you're iterating and being creative. I'm all ears if you can think of something though.
Post reply on HN