Hello,
would anyone be interested in a state switcher library/class based on the files (one .lua file=one state) as opposed to most of the state switchers linked from LOVE2D Wiki?
I created such a class for my game and now I can release it, if there you have need for it.
Basic concept simplified is as follows:
main.lua - loads everything and switches to any other state, e.g. mainmenu.lua
mainmenu.lua - main game menu - state switch e.g. based on the menu option...
newgame.lua - new game launch
credits.lua - credits etc.
etc.
Any state can switch to any other state. Best thing is you can overload (redeclare) any function, so you can have separate keyboard handling love.keypressed, love.draw functions for every state etc... without any further subclasses or enforcing any a state switcher class over you (it's just a function).
game state switcher class
Re: game state switcher class
You can check out my library: LovelyMoon
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: game state switcher class
You should definitely share it anyway! If it's bad we'll only make fun of you a little (NOTE: sarcasm, not serious).
Having too many options is almost never a bad thing.
Having too many options is almost never a bad thing.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Re: game state switcher class
OK, I put it together and you can find the state switcher here:
http://www.ambience.sk/love2d-a-state-s ... class-lua/
or a direct download:
http://www.ambience.sk/wp-content/uploa ... itcher.zip
Licensed under CC-BY, tested with the latest Love2D 0.9.1. Just run main.lua and it guides you through. Any feedback welcome.
http://www.ambience.sk/love2d-a-state-s ... class-lua/
or a direct download:
http://www.ambience.sk/wp-content/uploa ... itcher.zip
Licensed under CC-BY, tested with the latest Love2D 0.9.1. Just run main.lua and it guides you through. Any feedback welcome.
Who is online
Users browsing this forum: No registered users and 198 guests