Jump to content
  • Advertisement

Sure Shot

Member
  • Content Count

    38
  • Joined

  • Last visited

Community Reputation

140 Neutral

About Sure Shot

  • Rank
    Member
  1. Sure Shot

    C#: private constructors

    Because there is more flexibility in inheriting from XmlNode, since its designers figured that there are things that all subclasses of XmlNode would probably want to be able to do. If you used an interface, any class that implements XmlNode would need to override all of its methods. EDIT: I was a little slow to post...
  2. Sure Shot

    Converting int to char *

    He's using int's for his players' fuel and health and needs to convert them to char* s. Reread the post.
  3. Sure Shot

    Easiest 1 on 1 networking possible?

    If you're coding for a Windows platform you could consider using DirectPlay. There is plenty of documentation available to get you started with that. Or you could write a Peer-2-Peer API yourself, if you're adventurous.
  4. Sure Shot

    Univerisity... Game Development?

    This might be helpful to you :).
  5. Sure Shot

    Games Source Code

    Probably not, since they are proprietary, and hence, owned by Sony and/or the Developers. But, if you are new to programming in general, I wouldn't advise that you try to dissect thousands of lines of code. There are plenty of smaller open source games for download online, especially at Source Forge.
  6. Sure Shot

    Thoughts on C++0x

    Like Emmanuel said, it will take quite some time to implement in most compilers. But, I do believe that it will be used as widely as the C++98 standard is used now. I expect that C++ will remain the language of choice for most game programmers for far longer than 10 years.
  7. Your keybindings function should probably look like this if you want it to actually save the keybindings. //######################################################################### char* keybindings(void) //######################################################################### { char k[4]; // i use this to get the keybindings. cout << "Push UP: "; k[0] = getch(); cout << endl << "Push DOWN: "; k[1] = getch(); cout << endl << "Push LEFT: "; k[2] = getch(); cout << endl << "Push RIGHT: "; k[3] = getch(); return k; } Then, if you want to check if the user is pressing a certain key, all you would need to do is: char *c = keybindings(); if(getch() == c[0]) //Is the up key pressed? { //Do Stuff } [Edited by - Sure Shot on May 1, 2005 12:20:38 PM]
  8. Sure Shot

    clearing the screen

    This is often overkill for small console programs. If you're going to use the Win32 API, you might as well use a window for your output.
  9. Sure Shot

    Help with header file

    Assuming your filename is Int.h, your .cpp file code should look like this: #include "Int.h" #include <iostream> using std::cout; int main() { //...
  10. Sure Shot

    Teen needs Help with game designing

    Before you learn to make games, you should probably have a good understanding of a particular programming language. There are probably more tutorials for game development in C/C++ than any other programming langauges. You can find online resources at some of the following websites: www.gamedev.net (of course :] ) www.free2code.net www.cplusplus.com computer.howstuffworks.com/c.htm www.cuj.com www.mindview.net www.hotscripts.com/C_and_C++/Tips_and_Tutorials/index.html www.c-for-dummies.com msdn.microsoft.com www.cprogramming.com cplus.about.com/od/beginnerctutorial/l/blcplustut.htm These are just some useful sites for learning C and C++ that I was either able to Google, or have been to myself. If you have any questions, feel free to post on GameDev.net, because 99.99% of the people here are extremely nice and helpful.
  11. You could have i be a static member variable. In this case you could access it using the scope resolution operator like this: WE::i
  12. Sure Shot

    char to char*

    Quote:Original post by Solance edit and its it really a risk to use strcat? should i go with the string class? One reason is that strcat has no built-in bounds checking. Besides that, std::string is just easier to use and will save you headaches with problems like this. In C++, the Standard Library is your best friend :).
  13. You guys will really like this one. I went to great pains acting like a n00b to roll this out :). Written in C++ #include <iostream> #include <cstdio> #define X//Make #ifndef X//Sure #define X//The Preprocessor isn't broken #endif// Like last time using namespace std; int successvar1 = 0; int successvar2 = 0; void ThisIsTheFunctionThatUsesPrintf() { int x; const char* Hello = "Hello "; for(x = 0; x < 6; x++) { printf("%c",Hello[x]); if(x < 0 || x > 6) { printf("Some error occurred"); break; } } successvar1 = 1; } void ThisIsTheFunctionThatUsesStdCout() { int x; const char* Hello = "World"; for(x = 0; x < 6; x++) { cout << Hello[x]; if(x < 0 || x > 6) { printf("Some error occurred"); break; } } std::cout << "\n" << endl; successvar2 = 1; } int main() { enum { I_FAILED_AGAIN, IT_FINALLY_WORKED }; do // Main loop { ThisIsTheFunctionThatUsesPrintf();//Use printf for "Hello " ThisIsTheFunctionThatUsesStdCout();//Use std::cout for "World" break; } while(1); if(successvar1 == 1) { if(successvar2 == 1) { system("PAUSE"); return IT_FINALLY_WORKED;// It worked!! }} if(successvar1 == 0) { if(successvar2 == 1 || successvar2 == 0) { system("PAUSE"); return I_FAILED_AGAIN;// I can't believe I can't even print text to the screen :[ }} }
  14. Sure Shot

    who wants a gmail invite

    I also have 50; I remember when they actually sold on eBay, lol.
  15. Quote:Original post by methinks ....is there any way I can use pointer functions to point back directly to the class, thus not replicating the code in memory? I hope my question makes sense... You can use static member variables so the code is not replicated in memory, and the variable actually "belongs" to the class rather than the objects.
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!