Question

My goal is to design and develop a game which teaches people to program in Java.

The question is: Which possibilities are there to implement an IDE into a Unity game?

For example: Codespells is built with unity but implements a Java code editor in which you have some kind of code-auto-completion and a console.

I am also interested in other solutions apart from Unity, if there are some.

Kind regards

Was it helpful?

Solution 2

I would recommend implementing some sort of Java parser written in JavaScript into your game, then coding a simple ide (some menus and a command line) to surround it. I would use ANTLR, which is a general language parser which you can use to translate Java into Javascript to have it run in Unity. Another option is GWT, which allows you to write applications in Java and execute them in JavaScript. Hope you can use one of these two options, and good luck with your game.

EDIT: You could also literally start another application from within Unity if that would be useful to you. Something like the following on Mac:

import System.IO;

function Start() {
   var info:FileInfo = new FileInfo("/Applications/TextEdit.app/Contents/MacOS/TextEdit");
   System.Diagnostics.Process.Start(info.FullName);
}

Or this on Windows:

import System.Diagnostics;

var fileLocation: String = "C:/Program Files/Skype/Phone/Skype.exe";
var test:Process = new Process();
test.StartInfo.FileName = fileLocation;
function Start() {
   test.Start();
   UnityEngine.Debug.Log("we got here!");
}

OTHER TIPS

As the comments said, you don't need to reinvent the wheel. We have IDEs in the market which does the job well.

Regarding the other part of your question, designing a game to help people learn java... there is an excellent project going on, on this topic, named Alice. It is a carnegie-melon initiative.

http://www.alice.org/index.php

http://en.wikipedia.org/wiki/Alice_(software)

You might take a look at their source code and see if that give you some idea on your own development.

Maybe you could have a look at Scintilla. This is an open source multi platform text widget used in open source editors like notepad2 or notepad++.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top