One thing that would be very handy for a newcomer like me (= not new to programming, but new to game progamming),
would be a little concept level tutorial on where and how to do things like levels, powerups and for example story screens etc. also when to put things in the same file and when to use separate .lua files.
My first game mechanic didn't long to code, but right now I have everything in the main.lua file and its not going to be very flexible or manageable if I progress it any further in its current state.
So if someone has some good modular structure ideas that could be implemented in Löve, I'd be very grateful
Structure tutorial?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Structure tutorial?
Hi,
First of all, you'll find answer to half of your questions in Lua's official doc (using separate .lua files and so on). It's a good place to start.
About game programming and stuff like levels, menu screens and such, you could use a state based structure, each level and type of screen (menu, credits...) being a state. That's what I'm used to work with and it works well. Define each state and update/render the one you need in your render loop. Each state could be stored in a class with a custom update/draw method.
Sorry, I don't have code examples right here but I guess you won't have any trouble to implement this kind of mechanism if you're not new to programming.
Hope this helps,
Tom
First of all, you'll find answer to half of your questions in Lua's official doc (using separate .lua files and so on). It's a good place to start.
About game programming and stuff like levels, menu screens and such, you could use a state based structure, each level and type of screen (menu, credits...) being a state. That's what I'm used to work with and it works well. Define each state and update/render the one you need in your render loop. Each state could be stored in a class with a custom update/draw method.
Sorry, I don't have code examples right here but I guess you won't have any trouble to implement this kind of mechanism if you're not new to programming.
Hope this helps,
Tom
Who is online
Users browsing this forum: No registered users and 14 guests