Hi! I'm using DEV-C++ and need som help or something...
I've some questions about C++ and Dev-C++ here they are:
Can you put music or pictures in dev-c++ when you making something in Console Application?
It's something in my code i should chance?
How far can you go with Dev-C++ when your're making a game?
Should i chance C++ if i want to make a game?
It's someone who wants to work with me? My brother have an company there we make games so dreams can come true
What do you think of my code?
I've only been working with C++ in 4 days so I'm a noob.
Sorry for my english I''m from Sweden and I'm only 13 years old^^
Here is my code:
cpp
/*Name: WOP BETA 1.2
Copyright: W.O.P LTD All Rights Reserved
Author: Tommie Larsson
Date: 04-05-08
Description: A beta of the game and console W.O.P.
*/
#include <iostream>
#include <string>
#include <vector>
#include <windows.h>
#include <cstdlib>
#include <ctime>
using namespace std;
int main ()
{
cout << " " << endl;
cout << "\tWOP requesting login\n";
int security = 0;
string username;
cout << "\nUsername: ";
cin >> username;
string password;
cout << "Password: ";
cin >> password;
if (username == "Gamepower" && password == "j6wfmdd5")
{
cout << "\nWelcome Gamepower to WOP.";
security = 5;
}
if (username == "Unrealgamer" && password == "Unrealgamer")
{
cout << "\nWelcome Unrealgamer (Jens) to WOP.";
security = 5;
}
if (username == "quest" && password == "guest")
{
cout << "\nWelcome guest.";
security = 1;
}
if (!security)
cout << "\nYour login failed.";
else // <-- ADD ME
{
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << "Please choose difficulty level:" << endl;
cout << " " << endl;
cout << " " << endl;
cout << "Difficulty Levels\n\n";
cout << "1 - Easy\n";
cout << "2 - Normal\n";
cout << "3 - Hard\n\n";
int choice;
cout << "Choice: ";
cin >> choice;
switch (choice)
{
case 1:
cout << " " << endl;
cout << "Easy? You're a real noob!\n";
break;
case 2:
cout << " " << endl;
cout << "Normal of course!\n";
break;
case 3:
cout << " " << endl;
cout << "God luck!\n";
break;
}
cout << " " << endl;
cout << "This is just a beta of a game so we go directly to" << endl;
cout << "when you just have died in the game^^" << endl;
cout << " " << endl;
cout << " " << endl;
cout << "Gameover! " << endl;
cout << " " << endl;
}
char again = 'y';
while (again == 'y')
{
cout << "\nDo you want to play again? (y/n): ";
cin >> again;
}
cout << "\nOkay, logging out!";
std::cout << "Press the key to exit";
std::cin.ignore(std::cin.rdbuf()->in_avail() + 1);
return 0;
}
//Codegamer
This post has been edited by Codegamer: 4 May, 2008 - 12:01 PM