:^)
|
|
« Reply #620 on: October 24, 2012, 04:28:43 PM » |
|
I like the color clash. It's like a throwback to the glory days:.
|
|
|
Logged
|
|
|
|
happymonster
|
|
« Reply #621 on: October 24, 2012, 11:04:48 PM » |
|
Ah, that's the Amiga ECS (32 colour) version, a bit more garish than the 256 colour AGA/PC/ version.
Actually I've always thought that their palette choice to reduce the colours to 32 wasn't much good..
|
|
|
Logged
|
|
|
|
:^)
|
|
« Reply #622 on: October 25, 2012, 12:08:55 PM » |
|
ugly is in this year.
ask any fashionista.
|
|
|
Logged
|
|
|
|
happymonster
|
|
« Reply #623 on: October 27, 2012, 09:15:00 AM » |
|
I've been thinking the last few days of how to do some re-factoring to improve the code. It's getting a bit unwieldy and I want it to be easier to read and work with. So much pondering has occurred..
|
|
|
Logged
|
|
|
|
happymonster
|
|
« Reply #624 on: October 27, 2012, 04:24:17 PM » |
|
Started to get an idea of how to refactor the code.
I'm currently thinking of a very readable (in terms of naming) public layer over a private layer of internal functions. The idea being that I have to go through more readable functions and can't access internal data directly.
|
|
|
Logged
|
|
|
|
caffeine
|
|
« Reply #625 on: October 28, 2012, 12:23:19 PM » |
|
I don't know if I posted here before. If not I am sorry, because this game looks lovely. And I would very much like to play it.
|
|
|
Logged
|
|
|
|
happymonster
|
|
« Reply #626 on: October 28, 2012, 02:00:36 PM » |
|
Thanks Green.
|
|
|
Logged
|
|
|
|
happymonster
|
|
« Reply #627 on: October 31, 2012, 11:11:38 AM » |
|
Started first steps to re-factor some of the messy code.. it could take a while! What I would find interesting and useful is if any of you who use C/C++ who want to post bits of your code? That would be handy for me to see the style & design you use.
|
|
|
Logged
|
|
|
|
Lynx
|
|
« Reply #628 on: October 31, 2012, 02:24:15 PM » |
|
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xmlBeyond that, one approach you might take is to look up some open source project you like which was written in C++, and peer in their code repository to see how they structure their code. A lot of C++ source code structure extends beyond individual C++ source files, into header files, directories, build file structure, that sort of thing.
|
|
|
Logged
|
Currently developing dot sneak - a minimalist stealth game
|
|
|
Paul Jeffries
|
|
« Reply #629 on: October 31, 2012, 04:46:57 PM » |
|
What I would find interesting and useful is if any of you who use C/C++ who want to post bits of your code? That would be handy for me to see the style & design you use. Anything in particular you're interested in seeing examples of? (i.e. is it class structure, naming patterns, code fomatting...?) My code is probably mainly useful as an example of how not to do things but I'm happy to post some if it will help!
|
|
|
Logged
|
|
|
|
eigenbom
|
|
« Reply #630 on: October 31, 2012, 10:45:24 PM » |
|
Started first steps to re-factor some of the messy code.. it could take a while! What I would find interesting and useful is if any of you who use C/C++ who want to post bits of your code? That would be handy for me to see the style & design you use. Yes .. Style ... Design ...
|
|
|
Logged
|
|
|
|
happymonster
|
|
« Reply #631 on: November 01, 2012, 12:05:05 AM » |
|
Mostly naming patterns and code formatting. Thanks!
|
|
|
Logged
|
|
|
|
Joshua
|
|
« Reply #632 on: November 01, 2012, 07:37:17 AM » |
|
I use BSD KNF indent style for my personal projects, while my day job prefers I use K&R indent style. For naming, I use Camel Case for class name and method names and mixed case for member variables. I tend to inline getter/setters (if they are relatively simple) and I eventually have adopted the 'm_' prefix for private data members (after much grumbling). Sometimes I also find it handy to have a typedef'd pointer type. typedef Foo * FooPtr;
class Foo : public Bar { public: Foo(); virtual ~Foo(); int Getter() { return m_value; } void Setter(int value) { m_value = value; }
void SomeOtherPublicMethod(); private: int m_value; int m_someOtherValue; };
I this has been helpful, please feel free to pick my brain.
|
|
|
Logged
|
|
|
|
happymonster
|
|
« Reply #633 on: November 01, 2012, 09:47:56 AM » |
|
Hmmm.. Interesting! Judging by that guide I use (and prefer) an Allman style. (I never know the proper name for it)
|
|
|
Logged
|
|
|
|
Paul Jeffries
|
|
« Reply #634 on: November 01, 2012, 01:52:40 PM » |
|
I use an Allman indenting style (high five!) because I personally find it infinitely cleaner and easier to read than the alternatives. I use lower camel case for variables and upper camel case for function and class names. Private member variables I prefix with an 'm'. I used to use an underscore for that, but discarded it as it's microscopically more awkward to type.
|
|
|
Logged
|
|
|
|
happymonster
|
|
« Reply #635 on: November 01, 2012, 02:19:55 PM » |
|
Well, re-factoring is going well, but slowly. I need to tidy up and really sort out all the code. It's a big job, but it needs to be done. I'm not one of those programmers who constantly rewrites their programs, so it's definitely time to do it.. Once it's done - the code base will be much much better to follow and develop from.
|
|
|
Logged
|
|
|
|
eigenbom
|
|
« Reply #636 on: November 01, 2012, 02:54:21 PM » |
|
Here's a peek at some moonman code, hth. Also check out the source of SFML, its very consistent, clean and well documented. #ifndef MM_SYSTEM_SCRIPTMANAGER_H #define MM_SYSTEM_SCRIPTMANAGER_H
#include "mm/system/resourcemanager.h" #include "mm/common/filesystem.h"
#include <luabind/object.hpp>
#include <string> #include <vector>
struct lua_State; namespace mm { /** * ScriptManager manages the loading and interpretation of scripts. * (It supersedes LuaSpecManager and LuaBindings) */ class ScriptManager { public: ScriptManager(ResourceManager* rm); ~ScriptManager();
// startup (call this before any scripts are run) void startUp();
void* loadScript(const fs::path& p, const std::string& name); void bringInScript(void* data);
void registerCoreIDs(); void requireAllScripts(); void runScriptOnLoads();
void runString(const char* str); ///< run the lua command lua_State* luaState(); ///< access the lua state
// internal/helper luabind::object _mm_load_script(luabind::object scriptName); // void _mm_register_world_generator(luabind::object function);
void loadBindings(); luabind::object makeNestedTable(std::string dotSeparatedName); protected: ResourceManager* mResourceManager; lua_State* mL;
std::vector<std::string> mScriptNames; std::map<std::string,void*> mScriptDictionary; }; } // mm
#endif
|
|
|
Logged
|
|
|
|
happymonster
|
|
« Reply #637 on: November 02, 2012, 10:08:13 AM » |
|
I'm not a fan of CamelCase!
|
|
|
Logged
|
|
|
|
caffeine
|
|
« Reply #638 on: November 02, 2012, 10:50:37 AM » |
|
THIS reminded me of the art in your game.
|
|
|
Logged
|
|
|
|
happymonster
|
|
« Reply #639 on: November 02, 2012, 10:54:27 AM » |
|
Ohhh! That's nice graphics.. I can see the similarities, but also some subtle differences. They've got some great designs there for the tiles and characters. I struggle with that part.
|
|
|
Logged
|
|
|
|
|