Just Finished Triple X, but want to make some adjustments and output the game

Hi,

First time coder who started learning for the hell of it.

Just finished the first part of the Unreal course - at first, I was groaning a little about the idea of coming up with a story and just threw in a bad placeholder about a guy at work locking his key in the van and needing to get the spare key out of a key safe.

As I progressed, the story kind of evolved a heap and I found I had more and more creativity as I went through to the point where I want to do a couple of things with my Triple X game and hoping someone can help.

Firstly, I want to only have the introduction screen play once upon starting the game - I found a thread in my searches (My Progress so far ) where the OP basically managed to pull that off, but I need to compare the code to figure out how it was they managed it. If anyone has any tips, they’d be greatly appreciated.

Secondly, I’d like to be able to have each new “level” be different - have a new series of text, giving a different scenario and maybe even allowing for a 4th number to be guessed (of course, this will make the game much harder for the “player”, but that’s ok) in one or two of the scenarios. I imagine that this will effectively entirely multiply the amount of code required for each new scenario added, but my experiments haven’t been fruitful thus far and to even be pointed in the right direction would be really helpful.

Lastly, I’d like to somehow “export” the game somehow - even in the simplest, barebones means, somehow make it playable so I can share it with the people I work with. I imagine this sort of thing will be covered in later parts of the courses I’m working through, but even just as a dos .exe text based game.

It’s all “in-jokes”, so while I’d be happy to post the code I have:
i) I’d remove all of my custom strings of text/the “story” within it and thus:
ii) it’d be the same batch of code that anyone else managed to successfully manage to make at this stage of the course anyway, just without the story part of things.

Thanks in advance

Take it out of the loop. (PlayGame is called within the loop)

That can be done with a switch statement (or a chain of if/else if you want to stick with what you learnt in the course)

void PrintLevelText(int Difficulty)
{
    switch(Difficulty)
    {
    case 1:
        std::cout << "blah 1\n";
        break;
    case 2:
        std::cout << "blah 2\n";
        break;
    // ...
    default:
        std::cout << "this prints if there are no other matches\n";
        break;
    }
}

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms