Making the Game: The Opening Act
Starting Robotrooper: Simulation felt like a rude awakening. You launch the game and all of a sudden you're standing in this unknown place, holding a gun, being told what to do. To ease the player a bit more into the game, I added a splash screen, where the player is prompted to press any key to begin the game.
However, the game does not yet begin, because I also added difficulty settings. So the next thing the player does is pick one of them. They are casual, standard and rigorous (or easy, normal and hard, if you will). These change the amount of lives the player has and the amount of lives the turrets in the game have, as well as the speed at which they shoot out projectiles. Also, no hints are offered after dying and respawning at a checkpoint on the rigorous difficulty.
Implementation
The "Title Screen" widget is created and added to the viewport from the Level Blueprint. The Level Blueprint is ideal for code that is not reusable, i.e. executing code that needs only run once in the level. This is why the splash screen is here, as it is only ever run at the beginning of the game/level.
The "Press Any Key" text on the splash screen flashes in and out. This uses a Delay node and FlipFlop node. The value of a boolean changes every .75 seconds, either from true to false or false to true. The value of the boolean is directly tied to the binding on the text's Visibility.
The actual Any Key Event is also in the Level Blueprint. This is because Widget Blueprints do not allow for the use of any Input nodes (at least as far as I know - if I'm wrong, let me know). Anyhow, this event changes the values of a few booleans, which cause the difficulty setting choices to appear on screen.
When one of the difficulty settings is pressed, the player's "Difficulty" integer variable is set and a "Setup" Event on the player is fired as well. This event then calls all the relevant objects and changes their values based on the chosen difficulty.
Once that's done, the input mode is set to game only and the splash screen removes itself from the screen. The game begins.
I think this makes for a better introduction, though it could be spruced up with some extra stuff, such as sounds and maybe a nice fade-out effect... Tell you what, in my next game-related post, I will go over adding those in. See ya then!







Comments
Post a Comment