Inny's general techniques (project bronxcombat1999)
Posted: Mon Feb 24, 2014 12:55 am
Although a game about fighting double-dragon style in the bronx would be amazing, that's not what this project is (yet?). This thing is me trying to organize my general techniques together. Since I'm in a sharing mood, the repo is wide open for anyone to peek in, grab what they want, and swing out like a rum-drunk pirate.
The thing to note is that I organize according to this general idea:
Objects are composed, so the class-system is prototypical type where the __call metamethod sets the __index metamethod pointing at the parent, and then the rest of the objects all copies in. Everything deriving from object has on/off/send methods ala observer pattern. _init is called only during derivation, so each class has to care if it's a leaf or an inner-node on the tree.
Input and Graphics are big manager singletons that present an interface. Sound hasn't been added yet, but it'll follow the same pattern. Input's interface are tap, hold, and holdlen, and every input is translated into game-usable codes, so things like input.tap.menu_pageup are all most code should care about, with the input manager translating from love's inputs to game input. Graphics follows suit with regular things I want to do everywhere without going object-oriented, like writing text to screen.
Oh man am I regretting using the name bronxcombat1999 for this
This thing only presents a single gamemode, though I'd certainly want more like menu, credits, and so on.
Jumper physics is there just because I needed something to test against. I'll probably come up with a few more genre types that I could see myself wanting to stamp out games for. And of course loading tiled maps is a must, though I think going via the lua plugin is the way to go, rather than loading the tmx files.
Now of course the biggest thing I have to fight is the desire to rewrite this over and over. Maybe publicly shaming myself like this will do me good.
Github link: https://github.com/inmatarian/bronxcombat1999
The thing to note is that I organize according to this general idea:
Objects are composed, so the class-system is prototypical type where the __call metamethod sets the __index metamethod pointing at the parent, and then the rest of the objects all copies in. Everything deriving from object has on/off/send methods ala observer pattern. _init is called only during derivation, so each class has to care if it's a leaf or an inner-node on the tree.
Input and Graphics are big manager singletons that present an interface. Sound hasn't been added yet, but it'll follow the same pattern. Input's interface are tap, hold, and holdlen, and every input is translated into game-usable codes, so things like input.tap.menu_pageup are all most code should care about, with the input manager translating from love's inputs to game input. Graphics follows suit with regular things I want to do everywhere without going object-oriented, like writing text to screen.
Oh man am I regretting using the name bronxcombat1999 for this
This thing only presents a single gamemode, though I'd certainly want more like menu, credits, and so on.
Jumper physics is there just because I needed something to test against. I'll probably come up with a few more genre types that I could see myself wanting to stamp out games for. And of course loading tiled maps is a must, though I think going via the lua plugin is the way to go, rather than loading the tmx files.
Now of course the biggest thing I have to fight is the desire to rewrite this over and over. Maybe publicly shaming myself like this will do me good.
Github link: https://github.com/inmatarian/bronxcombat1999