Jump to content

Project 1 - Game Network 1.0

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
20 replies to this topic

#1
Donovan

Donovan

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 798 posts
I will be posting each of my project on here one after another. After starting project one I will not post project 2 until project 1 is done and completed.

Now, I am still not sure what I want to do here with project 1. I will either make this a gaming network all in its own or make it my code network to put up my projects. So here is the project code play with it check it out if you are new. My question is I would like this to be an online network is there anyway I can get like free hosting somewhere just to test it out? Also would I have to make special coding since it would be going online. I want it were you can login to a network with this console.


// Game Menu 1.0

// Created by Donovan Simon


#include <iostream>

#include <string>

using namespace std;


int main()

{

    string username;

    string password;

    string exit;

    string networkStatus;

    int playersinNetwork;

    

    playersinNetwork = 0;

    networkStatus = "Network Status: Online\n";

    

    do

    {

         cout << "                                Game Network 1.0\n\n\n";

         cout << "Welcome to 'The Game Network!'. This network was created\n";

         cout << "so the user could choose from a selected list of games,\n";

         cout << "then play the game after logging into the network. You\n";

         cout << "must be logged into the network before playing the game.\n\n\n\n";

         

         cout << "Please login to the Game Network.\n\n";

         cout << "Username: ";

         cin >> username;

         cout << "\n";

         cout << "Password: ";

         cin >> password;

         cout << "\n";

         

         if (username == "DarkAges" && password == "123")

         {    

             cout << "Succesful Login. You may now choose from the list of games to play.\n\n";

             cout << "People in the network: " << ++ playersinNetwork << endl;

             cout << networkStatus << endl;

             system("PAUSE");

             system("CLS");

             break;

         }   

         if (username != "DarkAges" && password != "123")

         {    

             cout << "The username and password you entered is incorrect!\n\n";

             system("PAUSE");

             system("CLS");

             break;

         }   

         if (username != "DarkAges")

         {

             cout << "The username you have entered is incorrect!\n";

             system("PAUSE");

             system("CLS");

             break;

         }   

         if (password != "123")

         { 

             cout << "The password you have entered is incorrect!\n";

             system("PAUSE");

             system("CLS");

             break;

         }

         

         }while (true);

         

         return 0;

         

}



Posted Image
+Friend Me | My Graphics | Forum Rules | Help Forum | Forum FAQ

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Quick observation: you are give a "hacker" information in your error messages. I would do something like:
if (username != "DarkAges" || password != "123")
         {    
             cout << "Your login credentials are incorrect!\n\n";
             system("PAUSE");
             system("CLS");
             break;
         }   


If you wanted to connect to a website or some-such, you are looking at learning how to do network programming. In particular, communicating via TCP/IP. You would also need to write code in a server-side setting to do the validation.

Edited by WingedPanther, 15 December 2008 - 10:58 AM.
answer the question asked

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
Also, I don't get this? Are you going to have a bunch of text based games? A virtual network loopback like VPN(Ie, Hamachi)?

#4
Lance

Lance

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
Nice try, Donovan. I am sure you'll achieve it one day.

I'll give my 2 cents when I have more time to dispose of. Bye for new.

#5
Donovan

Donovan

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 798 posts
I hope this works out.. I think I am getting a bit ahead of myself with this network project:D But hey doesn't hurt to try new things:P

#6
Lance

Lance

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
Yeah, it's indeed a long journey. Now you are taking on GUI too. Game programming is more than GUI only, you will also need to use GL or DirectX stuff. Net work is actual a much much smaller challenge. I was under the impression that C++0X is going to incorporate the Boost Asio network libary, so it will become even easier. GUI, however, will remain complex for many years to go. C++ stardard committee simply doesn't have the resource to create a standardized GUI or even a GUI standard. I myself is in constant search of a good crossplatform C++ GUI.

Do you have any idea what kind of a game you're going to build?

#7
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Game programming doesn't necessarily require DirectX/OpenGL. There are a lot of games with 2D graphics that require very little from a graphics standpoint.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#8
Lance

Lance

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
Thanks for the correction, WingedPanther.

I actually suggest that he go with text terminal for now. GUI can be a big distract to his learning C++. Catching 2 fishes at the same time probably is not a good idea. He has mostly learned some C subset stuff of C++. It's more helpful to move to some good textbook that teaches the OO part of C++, probably a little bit of GP, limited to the using of STL. And then get back to the topic he is interested, game programming, and relevant GUI stuff.

But since what he is interested is game programming, it could turn out to be the best way sticking with it.

#9
Lance

Lance

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
He is only 14 so he has plenty of time trying different things and ways. The boy who wrote DivX decoder definitely did not learn C as advocated by experts. Who knows :)

#10
Donovan

Donovan

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 798 posts
Hehe, I tend to jump out of my seat when I learn new things hah! Don't worry about this topic though I got carried away with the greatness of c++ :) I really need a good OO book though. So far I have the basics down I just need to start getting into more OO stuff. If I can get to the point where I know how to start coding Mushes that would be awesome. I think I have an idea on it but I would constantly be stopping to think on what to do haha.
Posted Image
+Friend Me | My Graphics | Forum Rules | Help Forum | Forum FAQ

#11
Lance

Lance

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
We would be happy to of any help in your journey on OOP in C++.

I guess it's a continous loop like

    read -> think -> write +
      ^                    |
      |                    |
      +--------------------+

Read good books/articles/forum discussions/actual code
Think if it's really like what people claims. Could it be done better in a different way? etc
Write, well you can write you game; apply the theory you learn on your actual work. Do not hesitate to reinvent wheels when learning a lauguage.

But it could be too dull for a boy at your age. The most important thing should be to have fun. Good luck, Donovan.

#12
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I agree that learning OOP in command-line first is probably the best way to go. It will help make GUI stuff make a LOT more sense, since GUI toolkits tend to be very heavily OOP, and not understanding the basics can make the journey much harder.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog