KevinWalters

Members
  • Content count

    4
  • Joined

  • Last visited

Community Reputation

103 Neutral

About KevinWalters

  • Rank
    Newbie
  1. I want to get Ethan and Kaleigh a puppy!
  2. A huge clean up from previous code. Can you tell the difference? // Game Stats // Demonstrates declaring and initializing variables #include using namespace std; int main() { int score = 72; double distance = 1200.76; char playAgain = 'y'; bool shieldsUp = true; short lives = 3; short aliensKilled = 10; double engineTemp = 6572.89; int fuel; cout
  3. Basic C++ Help Maybe?

    So after taking some advice I cleaned up the code a bit. Tell me what you think. Also is there like a IRC or Mumble server which has a bunch of game programmers that we can ask advice or hangout with? That would be amazing if someone could share me some info on that. // Game Stats // Demonstrates declaring and initializing variables #include <iostream> using namespace std; int main() { // Establishing variables and values int score = 72; double distance = 1200.76; char playAgain = 'y'; bool shieldsUp = true; short lives = 3; short aliensKilled = 10; double engineTemp = 6572.89; int fuel; // Printing information to screen cout << "\nScore: " << score << endl; cout << "Distance: " << distance << endl; cout << "Play Again?: " << playAgain << endl; cout << "Shields Up?: " << shieldsUp << endl; cout << "Lives: " << lives << endl; cout << "Aliens Killed: "<< aliensKilled << endl; cout << "Engine Temp: " << engineTemp << endl; // Printing information and receiving information cout << "\nHow much fuel? "; cin >> fuel; cout << "Fuel: " << fuel << endl; // Defining different types into user type typedef unsigned short int ushort; ushort bonus = 10; cout << "\nBonus: " << bonus << endl; // Ending program return 0; }
  4. Basic C++ Help Maybe?

      Thank you for the information. I'm actually reading the book Beginning C++ Through Game Programming Third Edition and I think it's going to show me just that. It takes you through the basics first and then shows you how to write the same program in a different format which I like so I'm not confused when I see it one way or the other like yours. You guys are awesome I didn't know this community was so active and helpful!
  5. Basic C++ Help Maybe?

      Sir as basic as that is you are awesome! Compiled perfectly fine thank you very much!
  6. Basic C++ Help Maybe?

    Okay I have a weird issue going on here that I can't seem to figure out. I must let you all know that I'm running Xubuntu 13.04 using gedit and g++ through terminal. Yeah this is how I wanted to start learning C++ and I was told this would be the best way. Here is my code. // Game Stats // Demonstrates declaring and initializing variables #include <iostream> using namespace std; int main() { int score; double distance; char playAgain; bool shieldsUp; short lives, aliensKilled; score = 0; distance = 1200.76; playAgain = "y"; shieldsUp = true; lives = 3; aliensKilled = 10; double engineTemp = 6572.89; cout << "\nscore: " << score << endl; cout << "distance: " << distance << endl; cout << "playAgain: " << playAgain << endl; //skipping shieldsUp since you don’t generally print Boolean values cout << "lives: " << lives << endl; cout << "aliensKilled: "<< aliensKilled << endl; cout << "engineTemp: " << engineTemp << endl; int fuel; cout << "\nHow much fuel? "; cin >> fuel; cout << "fuel: " << fuel << endl; typedef unsigned short int ushort; ushort bonus = 10; cout << "\nbonus: " << bonus << endl; return 0; } Now when I try to compile in terminal this is the error I'm getting. ************~/Desktop/dev/src$ g++ gamestats01.cpp -o gamestats01 gamestats01.cpp: In function ‘int main()’: gamestats01.cpp:18:14: error: invalid conversion from ‘const char*’ to ‘char’ [-fpermissive] ************~/Desktop/dev/src$ Can someone give me some insight on this? Also I have never programmed a day in my life. Is this okay for me to be using Linux and Terminal for starting? I hate Windows and would prefer not to touch it if I don't have to.