Monday, October 27, 2014

the PAWN

Alright. Here's my Pawn. I made a call here that I'm not sure of, but it's made and it works (so far). I know a lot of people would probably put all this on the Controller instead of the Pawn. But this works...
So, a little explanation: On Begin Play, We check on a saved game and load the info if there is one. We crate a saved game if there is not. The variables in my saved game are: LevelName(name), LevelComplete(bool), LevelUnlocked(bool), BestTime(int) and LevelIndex(int). They are all arrays. So all that info is loaded when the level starts.
Ball Control just sets the direction and speeds (public variable). This was made before the rolling template, by the way.
The Level Complete custom event stops the timer and adds the Level Complete menu.
The Start Game event is called from a UMG widget (menu) that starts each level. That menu displays level name and current best time. When the player clicks "Begin", the timer starts (after a little animation).
When the timer starts, the level is played. When that End Tile is hit, the Level Complete event fires and sets the level to end. This stops the timer and then takes the current level time and compares it to the stored best time. If you beat that time, it updates the saved game. We also set the level to complete and unlock the next level. Then the Level Complete menu pops up.

I'll do more on menus later. But this is really all of the actual game play function right here. It's VERY simple...and pretty fun (if I do say so myself!)

Questions and comments are welcome!

No comments:

Post a Comment