Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

117 Neutral

About FredOrJoeBloggs

  • Rank
  1. FredOrJoeBloggs

    Thanks Game Dev

    IMO its a myth. C# can be used to make tools, but so can other languages. Is C# better, depends on lots of things, but the answer is probably no, its just different. C# and VB both have full access to the .NET libraries so they should be fairly interchangable. C++ can also access all of .NET just using a different mechanisum. C# is probably easier to learn, but once you have learnt it the other languages will be easy to pick up.
  2. FredOrJoeBloggs

    Using Visual C++ 6

    And what makes you think Windows 8 will ever be used on the guy's system I've had to port code from VS6 to 2005, there were so many issues. But I agree, if this guy finds that he can do what he needs to for his personal enjoyment using VS6 then so be it.
  3. FredOrJoeBloggs

    Extended Ascii

    Are you using chars or unsigned chars? I ran the following program using chars and it came up with AB|BA but with unsigned it does the expected AB219BA. (| is meant to be the block symbol) chars are only 7 bits, because the top bit is always set, if I remember rightly, so 219 is really 91 (open square bracket). [source lang="cpp"]int CharacterDetectTest(void) { static const int constMaxCharacters = 5; const unsigned char maze[constMaxCharacters] = {65, 66, 219, 66, 65}; for (int i = 0; i < constMaxCharacters; ++i) { if (maze < 127) { printf ("%c", maze); } else { printf ("%d", static_cast<int>(maze)); } } printf("\nPress enter to exit\n"); return fgetc(stdin); }[/source]
  4. FredOrJoeBloggs

    Creating a new game

    You want to find a Game Engine that will do what you want to do in a language you think you can do it. Since you want it to be web based an easy way to start would be by looking at JavaScript and HTML5. They are not the best places to learn how to program, but you should be able to see if you like writing games. Try www.w3schools.com and http://www.tutorials...t.com/index.htm for learning the languages. Once you are ready to go beyond clicking on smiley faces and putting up messages boxes then search the web for Javascript game engines, first one I got back was craftjs.com, there seems to be an upwards scrolling shooting game as a demo on there, but I haven't looked at it in any depth. Good luck (Oh you'll need an editor, try Notepad++ from www.portableapps.com)
  5. FredOrJoeBloggs

    Creating & deleting pointers

    Oh in what sense is that a bad thing, as this is definitely games coding! [/quote] It depends on what your compiler does. If it compiles the code as is, then it will waste a few instructions. If the compiler optimises the code, it might well remove the code. If you want speed remove redundent code before you compile. So if i want to store floating point numbers and strings they can just be basic type def calls and that will save on CPU power will it?, what would I need to use the dynamic memory for? just the initial instantiation of the class (or Animal) into a vector (as in larspensjo's example), and then delete it if the object dies in game for instance. [/quote] Dynamic memory is useful if you don't know who many of the objects you are going to have. If you know how many objects of a certain type you will have at maximum AND the amount of memory that uses doesn't hinder the running of the program then use stack memory. However since you are using a std::vector you are already using dynamically allocated memory (al be it managed in a library for you). The objects that you are placing into the vector can have dynamic memory, but they could also be 'non-dynamic'. If performance is an issue then write your code such that you can replace the way the data is stored without affecting the rest of the code and then bench mark the two options by performing so many thousand operations that will excersize the code. [source lang="cpp"]#include <afx.h> #include <string> #include <vector> class CAnimalsD { // Animal class using dynamic memory public: typedef std::vector<CAnimalsD> VECTOR; public: CAnimalsD(const std::string& name = "", const int& health = 2) : m_pName(new std::string(name)) , m_pHealth(new int(health)) {} CAnimalsD(const CAnimalsD& other) : m_pName(new std::string(*other.m_pName)) , m_pHealth(new int(*other.m_pHealth)) {} ~CAnimalsD() { if (m_pName) delete m_pName; if (m_pHealth) delete m_pHealth; } private: std::string* m_pName; int* m_pHealth; }; class CAnimalsS { // Animal class using static memory public: typedef std::vector<CAnimalsS> VECTOR; public: CAnimalsS(const std::string& name = "", const int& health = 2) : m_Name(name) , m_Health(health) {} CAnimalsS(const CAnimalsS& other) : m_Name(other.m_Name) , m_Health(other.m_Health) {} ~CAnimalsS(){} private: std::string m_Name; int m_Health; }; // Gash test program. int main (void) { static const int constTestCycles = 10000; CAnimalsD::VECTOR animalsD; CAnimalsS::VECTOR animalsS; const DWORD startTime = GetTickCount(); for (int i = 0; i < constTestCycles; ++i) { animalsS.push_back(CAnimalsS("FRED", i)); } animalsS.clear(); const DWORD midTime = GetTickCount(); for (int i = 0; i < constTestCycles; ++i) { animalsD.push_back(CAnimalsD("FRED", i)); } animalsD.clear(); const DWORD endTime = GetTickCount(); printf("dynamic test = %d\n", midTime - startTime); printf("static test = %d\n", endTime - midTime); printf("press enter to exit\n"); return fgetc(stdin); }[/source]
  6. FredOrJoeBloggs

    I need them helps... again!

    Kripis, This might help you http://www.tutorialspoint.com/cplusplus/index.htm
  7. FredOrJoeBloggs

    Creating & deleting pointers

    MyAnimal1 is created on the stack The pointers within the class are created on the stack. The memory that the pointers point to is created on the heap. Because of the way you have written you destructor all the memory will be released when it is called, so you have done everything right. Especially the redundant nulling of the pointers, its good practice, but might have performance issues in games. However, I can't see why you are using dynamic memory for this data, why not just let the class members be a string and an int? I apreciate you may have simplified it for the question, in which case ignore this comment.
  8. FredOrJoeBloggs

    Complete beginner

    C++ is a great language, I've been using it for 20+ years. Don't try an learn it as a first language, it will destroy you. C#, VB, etc are really cool languages, but the sheer volume of library functions is enough to put anyone off. Python also has a lot of libraries and again this can cause issues when it come to learning. Also (since I guess you ultimate aim is to learn C++) it has a number of un-C++ like areas that might cause you issues when you try and move over. JavaScript is probably quite a good place to start. It has no cost, Firefox and notepad will get you going and you can get quite complex with it. I think it will be quite easy to get to grips with thinking like a programmer, which is what you really need to learn, not the language, also its quit C like. (see www.w3schools.com)
  9. FredOrJoeBloggs

    Can I avoid the hassle of these IDE's?

    I know what you mean. Until the last 12 months I have always used Visual Studio 6 to 2010 for C++ and its always been really simple and easy. At work we team it up with Scons and don't have an issue, at home I spend and extra 5 minutes getting the settings right before I start doing too much. Then I started with PHP. It was an absolute nightmare. Like you said editing the code was easy, but getting it to run was a nightmare. Java was worse still, Netbean might well be a great tool, but its totally alien to me, all the shortcut keys are 'wrong'. IDEs are meant to make things easier, but if they don't then don't use them. You can use Visual Studio from the command line, or you can call the compiler and linker directly, but I think it will get a bit teadious to keep doing it all manually every time, so get a 'make' like tool or script. But is learning how to configure a make tool that much different to learning how to use an IDE in the first place.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!