Updates- Enemies, Platforms, Etc.


Here is a link to a video of all the elements in play:

Coding 1 Project (youtube.com)


Enemies can be defeated by running into them. Once all enemies are defeated, they will respawn where the spawner blueprints were created as long as the current enemy total tests false for being greater than 0.

Code for Enemy Spawn Manager

(Code for Enemy Spawn Manager)


Another addition to the game is health and mana potions. The code is very similar for each. How they work is when the Player's character runs into the potion's collision box the player is able to pick it up if the player doesn't already have an item in their hands. If the code finds the player does have an object, then it will not let the player pick it up until they press 'Q' to drop or press the left mouse button to use the potion. 

(Code for Player Character Actions)

We also created an interface for items that can be used for multiple blueprints. In this case the interfaces are Pickup, Drop, and Primary Action.

(Code for Health/Mana Potions)

A timeline was created to get the moving platform to work and Lerp to have the object move between the beginning and end points of the platform. This code then loops so it keeps moving. However, I'm not quite sure how the flip flop works exactly within the code.

Code for Moving Platforms

(Code for Moving Platforms)

When the player steps on a falling platform it is activated and a 1 second delay until the platform falls and drops for 3 seconds until it resets where it started. There is also a different material/color for if the platform is activated, dropping, or ready and changes once the player activates the platform. 


(Code for Falling Platforms)

Other additions included cycling the colors/materials of the keys by shuffling the colors and key lists. 

(Code for cycling the color of Keys)

Get Coding 1