Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: I did it! Yay!  (Read 9721 times)

0 Members and 1 Guest are viewing this topic.

Dilbert

    Topic Starter
  • Moderator


  • Egghead

  • Welcome to ComputerHope!
  • Thanked: 44
    Re: I did it! Yay!
    « Reply #15 on: March 30, 2007, 10:49:38 AM »
    What compiler?
    "The geek shall inherit the Earth."

    Neil



      Expert
    • Fear me Track. Noone can escape my wrath.
    • Thanked: 3
      Re: I did it! Yay!
      « Reply #16 on: March 30, 2007, 12:23:08 PM »
      C++ 2005 Express Edition. But I sent it to my friend without a compiler installed, and it would not run, so I might not have made a "full" compile or something. Check the link I sent you. It is an excellent tool to greatly shrink the size of your compiled exes and does not require anything special for people receiving your program.

      Dilbert

        Topic Starter
      • Moderator


      • Egghead

      • Welcome to ComputerHope!
      • Thanked: 44
        Re: I did it! Yay!
        « Reply #17 on: March 30, 2007, 12:31:40 PM »
        I did use it. Before UPX: 481 KB. After the best UPX had: 283 KB. Packing that in a .7z file with Ultra compression: 105 KB. That's it; it's compressed and compressed again.
        "The geek shall inherit the Earth."

        Dilbert

          Topic Starter
        • Moderator


        • Egghead

        • Welcome to ComputerHope!
        • Thanked: 44
          Re: I did it! Yay!
          « Reply #18 on: March 30, 2007, 10:57:07 PM »
          I'm still looking forward to your escape game! ;)

          I've begun it again, the right way. I went to a C++ forum and got some pointers. I then realized how stupid my mindset was. I am writing OOP -- true OOP -- and *censored* it, it feels good!

          Here's what I did in earlier attempts:

          I created a class timsBedroom class. All usable objects were variables, BOOL for if they were in possession, and possibly an int or two. All, mind you, in a timsBedroom class. Imagine how silly this looks for a moment. In a timsBedroom object, I'm wondering about whether the reading light from that room is in player's possession, and this BOOL is next to the BOOL that asks whether the door is closed or not!

          I was on the right track, but it wasn't it. Then, I learned about member classes. It clicked. Now, I've got a bedroom object (of which timsBedroom will be an instance) with a desk object with computer and reading light child objects... just like a forum. Main boards(classes), in which are some threads (variables) and child boards (child classes) with threads (variables) of their own. Just found the term in my book: I'm referring to aggregation, the has-a relationship. :)
          « Last Edit: March 30, 2007, 11:34:36 PM by Dilbert »
          "The geek shall inherit the Earth."

          Neil



            Expert
          • Fear me Track. Noone can escape my wrath.
          • Thanked: 3
            Re: I did it! Yay!
            « Reply #19 on: March 31, 2007, 05:25:54 AM »
            Hee hee well done! I find it's a bit odd you can nest classes and not functions but oh well! Once you've finished, consider redesigned so your game has its own script read from a text file. Then your game will be truely generic, rather than a hardcoded story. Like I noticed in your suicide game, you've basically hardcoded all the conversation into functions. I would suggest some kind of "event\room\scene" class, containing an id number, string for the room's description and choices, and then a list of choices which lead to other ids (for moving) of affect variables, for picking up and stuff.

            Dilbert

              Topic Starter
            • Moderator


            • Egghead

            • Welcome to ComputerHope!
            • Thanked: 44
              Re: I did it! Yay!
              « Reply #20 on: March 31, 2007, 11:09:27 AM »
              You mean, allow users to edit the story file, by having the program read from text? That'd be good. Heck, it'd save on space in the actual .cpp file. *Starts looking up text file parsing tutorials

              As for the aggregation, I'm not nesting classes, I'm doing something like this:

              Code: [Select]
              class A
              {
              public:
                  A();
                  ~A();
                  //Other declarations
              };

              class B
              {
              public:
                  //Stuff
              private:
                  A theA;
              };

              This way, I can define a class Door, and have all rooms in the house have doors:

              Code: [Select]
              class LargeBedroom
              {
                  //Other
              private:
                  door toLivingRoom, toMasterBath, toCloset;
              };

              Now, I can use these classes in multiple areas, multiple times. :)
              "The geek shall inherit the Earth."