views:

1683

answers:

5

I wonder if there are any game engine written in Scala or easily accesible from Scala?

+5  A: 

All the Java gaming engines are easily accessible due to easy Java integration. There are several (not sorted in any way):

A good presentation how to start coding a game in Java is Write a 3-D Game in the Java Programming Language in Less Than 50 Minutes that applies as well.

As Scala has a nice Java integration the ointerop should be easy. As mcherm pointed out, for lwjgl this has already been done. To have the nice Scala feel you could add some implicit conversions.

Peter Kofler
+1. However, I doubt these java libraries make you easy to apply the nice features of scala (closures and what not).
kd304
Except for Scala implicit conversions of course; you can make anything scala-fied
oxbow_lakes
+2  A: 

ScalaBox2D

It's probably not a full fledged game engine though. (I dunno I have never written large games).

ePharaoh
+3  A: 

Here is an example of someone using a library like LWJGL from Scala. That seems like your best plan -- integrate with a good Java library. The integration betweeen Scala and Java is quite strong: in order to use such a library you need to integrate in "both directions": call Java code from your Scala (to do things like drawing to the screen) and also implement Java interfaces from your Scala code (to do things like responding to events). Fortunately, Scala makes it quite easy to do both.

One thing to realize though is that you will NOT be using the Scala command prompt. You will be compiling to .class files to produce a Jar, then running in the JVM. Not a big deal, but it does lose one small advantage of Scala.

mcherm
+1  A: 

There is such engine in the works. Right now I am building a solid base with an easy to use math library to be optimized via compiler plugin. The math part is finished, including all the vectors, matrices, quaternions, rotations and projections for setting up the camera and ready to be plugged into opengl pretty much out of the box. A simple renderer will be done in a near feature. The compiler plugin will take time.

Link: Simplex3d

Lex
Erm, why do we need two scala game engines in the tiny-already scala world. Wouldn't it be better if Lex and Matt Hicks would cooperate?
Elazar Leibovich
+2  A: 

I am currently working on a 3d engine in Scala: http://www.sgine.org

It still has a long way to go before it's a competitor to the major Java engines out there, but good progress is being made and more help is always appreciated. :)

Matt Hicks