door with keycode entry - random
ok I have the main stuff in place. Player finds a slip of paper that has the keycode password to open the safe. No problem. BUT, the game lacks replay ability because once you know the code there is no point in playing any of the rest of the level. Any ideas on how to make this not a one time shot. I'm thinking randomizing won't work if used like most randomizing as the piece of paper and the actual code to open need to match. SO some kind of array with maybe 10 variables, 10 different textures on the slip of paper that correspond to the 10 different combinations to open the safe? maybe 10 different textures on the paper - 9 of which are disabled and 9 different keypad scripts with 9 disabled. and a master script that controls them both? For instance, a randomizing script that will pick a set and disable the rest and a set will consist of the keypad code to open the door and the corresponding texture on the piece of paper that displays the code? If I can get this far then randomizing where the piece of paper is hidden will be the next step which won't be hard. So my question is simply does this sound like the way to go about it or anyone have better ideas. i guess another option is to have 10 identical scenes except for the texture and keycode then just have the game load a random scene. that would be easiest as far as not having to figure out how to randomize and match the texture to the keycode but seems like an awfully big hit performance wise - or at least file size of the game
Answer by andrew_2992 · Jul 01, 2016 at 07:57 PM
I dont know if this has something to do with an ongoing topic but i have no idea what you're trying to make so I don't know what to suggest.
...What is the point of the game? You collect a key code to open a safe, but if youre collecting one key code to open one safe then it should always be the same key, it doesnt even matter what the key is, it just opens the safe.
Maybe pick up 3 different key codes that all have part of a problem leading to the answer which opens the safe.
For example,. create a class called safe. When the level loads and the safe object has its start function, call another function inside of start which will calculate something, maybe 53, then divide it into 3 different sized parts... 10 + 30 + 13. Your safe class could have a reference to 3 other scripts, and take the 3 numbers and put load them into some variable or function which will end up displaying that part of the sequence visually in your game. then when the player collects all 3 they go to the safe and unless they actually know the 3 numbers theyre going to have a hard time guessing a number between one and 100,000 for example... Thats one way...