I decided to get back into Lua programming, and remembered I had already made a project before: viewtopic.php?f=5&t=21875, so I decided to see if I could recreate that but this time with a bit more programming experience and maturity under my belt.
So far, I have not done much, but for what it's worth, here's the current (veerry basic, and broken) iteration:
Currently I'm struggling with a bug where one of the entities "takes over", it's the only one destroying others, and is not getting destroyed itself. I'm guessing there is something wrong with either my collision detection (aside from the fact I'm using an "or" for comparison instead of an "and", which I'm doing just to better see what is happening), or I've not understood the "inheritance" I ripped straight out of the PiL book correctly, and something is not getting it's information as It should.
I'm also looking for general and more personal help in game making, since I have trouble gathering the motivation to read books and in general get on to learn more, and since currently there are no good teachers around to bug. I guess that is material for it's own post really but I thought I'd put a small notice here, in case anyone is interested in helping me .
Eboruushion evolution sim, second attempt
Re: Eboruushion evolution sim, second attempt
Nice! I remember playing a "game" like that on our old school computers. You could only increase or decrease food and watch the effects it had on population numbers. It was a lot of fun!
Personally I prefer a closure-based approach for OOP in Lua and I think it is easier to understand and work with than the metatable variant. But as always that's just my personal opinion. You should check it out and see if you understand it. I don't think using something you don't understand is good when you are starting to code. That's why I also recommend to avoid libraries and instead try to come up with something on your own. If there is something you can't handle without a library, lower the scope of your project
As a general suggestion you should start splitting your code into separate files (e.g. the Entity class should go into a file called Entity.lua and so on). Apart from making your code a lot more readable it also helps you to break down the program into logical blocks and think about how to "design" your program.
Last but not least: I haven't read any books when I started coding. I learned coding by modding games (lots of creeping through foreign code) and when I started writing my own games I started with small stuff like Pong, Tetris, Game Of Life and so on ... I just read tutorials when I came to a problem / point where I got stuck. You SHOULD learn more about Lua though ... you can't really code if you don't speak the language you want to code in There are tons of short tutorials out there and the basics of the language are easy to pick up.
Personally I prefer a closure-based approach for OOP in Lua and I think it is easier to understand and work with than the metatable variant. But as always that's just my personal opinion. You should check it out and see if you understand it. I don't think using something you don't understand is good when you are starting to code. That's why I also recommend to avoid libraries and instead try to come up with something on your own. If there is something you can't handle without a library, lower the scope of your project
As a general suggestion you should start splitting your code into separate files (e.g. the Entity class should go into a file called Entity.lua and so on). Apart from making your code a lot more readable it also helps you to break down the program into logical blocks and think about how to "design" your program.
Last but not least: I haven't read any books when I started coding. I learned coding by modding games (lots of creeping through foreign code) and when I started writing my own games I started with small stuff like Pong, Tetris, Game Of Life and so on ... I just read tutorials when I came to a problem / point where I got stuck. You SHOULD learn more about Lua though ... you can't really code if you don't speak the language you want to code in There are tons of short tutorials out there and the basics of the language are easy to pick up.
Re: Eboruushion evolution sim, second attempt
Nice! I made something similar to this a long time ago in Pascal with some friends, and more recently reimplemented it in JavaScript. The explanation is in Spanish though. But it allows speciation (try random seed 4 to watch two species arise, the "light seekers" and the "straight walkers").
Evolution Laboratory (in Spanish)
Evolution Laboratory (in Spanish)
Who is online
Users browsing this forum: No registered users and 2 guests