segunda-feira, 26 de maio de 2014

A very simple game in Blueprints


In the upcoming articles we will develop a small game to practice some concepts of Blueprints.

This game will be created using the "TP_ThirdPersonBP" template of the Unreal Engine 4 editor.


The game has the following rules:

  • The player must collect the small statues that appear in the scenario before time runs out.
  • The initial time is 30 seconds.
  • The game is over when time equals zero.
  • The game starts at Level 1 and the maximum Level is 5.
  • There are 3 statues in the scenario that change position periodically.
  • The time in seconds to change the position of a statue is the result of the expression "6 - Level".
  • When the player gets a statue, it reappears in another random position.
  • The score of a statue collected is given by the expression "10 X Level".
  • Every 5 statues collected, the player increases a level and get 15 seconds of time.
  • The values​​ of time, score and level will be drawn on the screen. 


I tried to make the game as simple as possible. The main Blueprints the game uses are:

  • GameHUD: This Blueprint controls the game variables such as time, score and level. It is also responsible for drawing this information on the screen.
  • Statue: The Blueprint of the statue checks the collision with the player and has the logic to change its position periodically.
  • MyCharacter: This Blueprint represents the player and is part of the "TP_ThirdPersonBP" template. This Blueprint has not been modified for this game. 
  • MyGame: This Blueprint is part of the "TP_ThirdPersonBP" template. The only change will be the selection of the "GameHUD" Blueprint as the HUD of the game.
 
    The preparation of the scenario and the script of the Blueprints "GameHUD" and "Statue"  will be seen in the next articles.


    Next: Initial preparation of the game
    Prev: Logical Operators and Boolean Expressions
    Table of Contents