Era-Dorta / gosu-android

A Gosu implementation for Android devices, undergraduate project
MIT License
31 stars 2 forks source link

ReadMe + Gosu Interopability #10

Closed ashes999 closed 11 years ago

ashes999 commented 11 years ago
Era-Dorta commented 11 years ago

Thanks for the code, I meant to do it myself but I had totally forgotten it.

ashes999 commented 11 years ago

Glad to be able to help. This is a fantastic project and I wish I could do more.

Era-Dorta commented 11 years ago

I've just realised that I might have merge this pull request without thinking too much about the code changes. Why would you require ruboto/util/toast if RUBY_PLATFORM is not java? Since Gosu is originaly written in C++ it will never be interoperable with gosu_android, gosu_android is in fact a reimplementation of Gosu from top to bottom, not an extension.

ashes999 commented 11 years ago

=~ means "regex match." So RUBY_VERSION =~ /java/ means "if the RUBY_VERSION value matches the regex java, then include the ruboto toast.

Anyway, you're right that it's nonsensical; I have this change in my proof-of-concept code, and this was required to make it run. I'll check and see if I can remove it, because I should be including gosu instead on non-Java platforms.

Also, how is this a complete reimplementation? I thought you just rewrote some parts in Java, not necessarily the entire framework.

Era-Dorta commented 11 years ago

If you don't mind I'll just correct and commit instead of reversing the pull request. About the code, as I said Gosu is almost entirely written in c++ and uses swig so it can be called from ruby. So what I've done is translate to java/ruby the logic and then use the android api to mimic the behaviour of events, drawing and sound. Of course since Gosu is such a large engine I've simplified many modules.

ashes999 commented 11 years ago

Fascinating. An interesting (but hard) alternative would be to make it run with mruby instead. But mruby has its own challenges (like no require functionality, and lots of standard ruby functionality as gems instead of core Ruby) so you probably picked the fastest/easiest of the (many, hard) possibilities...

Sure, go ahead and reverse the change. I'll verify tonight and let you know how it plays out on my end.

ashes999 commented 11 years ago

Confirmed: this is not needed.