You didn't explain what each piece of code does. Currently, to someone new to programming, both your java code and Lua code are as clear as mud. Try to explain what you're doing and why you're doing it, what you can do, what are you limited by, etc. A little constructive advice maybe? Please don't ...