Announcement

Collapse
No announcement yet.

Created my first little game in C++ only

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Created my first little game in C++ only


    #2
    Is that from some udemy tut?
    Watch out for mistakes with pointers, sometimes such thing can crash unreal and visual studio to desktop (or even blue screen). So make backups of whole project at least daily.
    On rare occasion such crash corrupts everything.

    Comment


      #3
      impressive. next up a calculator

      Comment


        #4
        Originally posted by Nawrot View Post
        Is that from some udemy tut?
        Watch out for mistakes with pointers, sometimes such thing can crash unreal and visual studio to desktop (or even blue screen). So make backups of whole project at least daily.
        On rare occasion such crash corrupts everything.
        That is from a tutorial I was following along until ... it stopped working LOL
        I had to think on my feet and put my own code in there to make it work.
        The first problem was that the 2nd int needed a value otherwise I get a build error.
        I didn't really know what to do so I "guessed" that I should probably just give it a value that is not the secret number.
        And it worked.
        I almost fell off my chair :-)
        Oh and then the command line window kept closing on my right as the right before the end.
        So I forum searched that and discovered: while (secretNum != 'e')
        But it was something else in there than the secretNum I figured I had to put that in there and it worked.

        So there was a tiny bit of thinking on my end :-)
        For me its huge because yesterday was my first day with C++ :-)

        Today I am going to try and code something on my own without following a tutorial.
        I already built the calculator that was pretty easy.

        I had an idea last night for a little quiz game and I want to huge variables and while loops and a little score system see if I can figure it out on my own :-)

        Comment


          #5
          The code is here:

          #include <iostream>

          using namespace std;

          int main()

          {

          cout << "TheLittleGuessingGame" << endl;
          cout << "---------------------" << endl;
          cout << "Coded in C++ in VS 2019 by Etienne Andlau" << endl;
          cout << "A World of Clouds game www.WorldofClouds.com" << endl;
          cout << "--------------------------------------------" << endl;

          int secretNum = 7;
          int guess = 0;

          while (secretNum != guess) {

          cout << "Guess the secret number. Enter any number from 1 to 10: ";

          cin >> guess;

          if (secretNum != guess)

          cout << "Nope. Try again." << endl;

          }

          cout << "You Win!";

          while (secretNum != 'e');

          return 0;

          }

          Comment


            #6
            The int guess = 0 I put in there myself the tutorial had it just as int guess and that didn't work.

            Comment


              #7
              Originally posted by savagebeasty View Post
              impressive. next up a calculator
              Already built a calculator and calendar too easy moving on today to try and code my own little quiz game :-)

              Comment


                #8


                the sky is the limit with C++ you'll never want to go back to silly spaggetti nonsense blueprints

                Comment


                  #9
                  Originally posted by savagebeasty View Post


                  the sky is the limit with C++ you'll never want to go back to silly spaggetti nonsense blueprints
                  Sadly I am not really a coder so I will probably stick with BPies to build my games but I definitely want to learn to do more in CPP.
                  I know there are things you can do in CPP that you cant do in BPies so I do want to skill myself up with it.
                  I am having a ton of fun though I really want to take this further :-)
                  This is going to kill my weekend I can see that coming :-)

                  Comment


                    #10

                    Comment


                      #11
                      How to build a calendar using C++?
                      Would you give a reference to a source?

                      Comment


                        #12
                        Originally posted by RuskinF01 View Post
                        How to build a calendar using C++?
                        Would you give a reference to a source?
                        I just searched on YT for tuts. There are lots.
                        Here is one example: https://www.youtube.com/watch?v=rHBaOg5Bp7o

                        Comment

                        Working...
                        X