Jump to content

Text based "RPG" in lua?


andrewdonshik

Recommended Posts

To clarify: Java is not a functional programming language in the sense that I meant it, where functions can be passed around like variables.

I'm trying to think of a language without at least some form of functional programming other than assembly (which isn't a language so much as a transcoding)

LISP-like dialects for sure such as Clojure. But I was thinking more along the lines of Scala or Javascript (the latter is actually pretty good at it outside of the browser and with certain language "features" avoided).

Link to comment
Share on other sites

To clarify: Java is not a functional programming language in the sense that I meant it, where functions can be passed around like variables.

Well, you're right, but you can mimic the same functionality with not too huge a memory or performance loss (unless you're in a tight loop) with instantiation of memberless classes. I do wish Java had method references of some kind, but the pattern of dispatch with enum + instantiate empty class (like for packet types by integer ID in the packet) works well.

Link to comment
Share on other sites

Well, you're right, but you can mimic the same functionality with not too huge a memory or performance loss (unless you're in a tight loop) with instantiation of memberless classes. I do wish Java had method references of some kind, but the pattern of dispatch with enum + instantiate empty class (like for packet types by integer ID in the packet) works well.

Correct, but such "features" of Java tend to be more advanced topics than basic inherent properties of the language. I'm sure given any language and enough free time, one language can be developed such that it can mimic the inherent features of another.

Link to comment
Share on other sites

Yes, some of Java's basic inherent properties are a bit iffy, such as the lack of unsigned types. I"ve gone through all the argumentation, and I won't say I disagree with it, but having to do

int foo = 60_000 ;

short bar = foo & 0xFFFF ;

foo = bar & 0xFFFF ;

to not have the sign bit interfere is...irritating.

Link to comment
Share on other sites

Java is very similar to Lua (they are basically the same thing)

hold the phone here, that is not even close to true. they are similar in that they are programming languages and have a few shared syntactical bits that are common to most high level languages. that is where it ends. lua is a) not based on or dependent on java, and B) a scripting language as opposed to a compiled language. yes I know java JIT compilations and byte code, but it's still compiled.

lua has some very different ideas about things like variables and objects as opposed to java.

edit: to the topic at hand, lua is perfectly capable of handling a text-based RPG type game. I say go for it. I learned a lot when I tried to do something similar with C++ many years ago.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...