0

For instance, if I wanted to make a game which used a Python main file, but have another file with Ruby methods on it, how would I call those methods individually?

Secondly, how could I make a Ruby gem/library with python code in it? I can't find a way other than exec("python file.py") which is not a gem, requires the shell to be active, and have Python installed, so that wouldn't be as reliable as I'd want it to.

1

1 Answer 1

1

If you want to do a game, create it in a single language. As it stands, games are already pretty taxing programs. Even looking at a games basic structure, you have a main loop that is executing consistently, while updating absolutely everything within the games world.

Now while it would be an interesting idea to combine two languages, think of what that would do to performance. You would have to call another program from within the game to execute that code, which takes up extra time, which could frustrate players if its noticeable (and i have a feeling it would be).

I'd honestly say go with just python or just ruby. However, maybe later on down the line, if you build your own engine from scratch, you could implement a Ruby-like scripting language (though that could be a whole other thing and topic of discussion in itself).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.