Posted July 22, 2025 by jordynwinter
New blueprints created and added, learned through Wichita State.
Doors-Testing if player is overlapped on door box collision and get their key count, if key count is less than 1, returning message that they need more keys. if they have at least one key, one is removed and new key count is set, then the door is destroyed to open it.
Keys- Upon start of game (Event Begin Play), every key will tell the player of its existence. Testing if player is overlapped on key box collision, print string that the key has been picked up and add a key to the player's key count and tell player how many keys they have, then destroy key from the map.
Key Colors- Gets an array of all keys placed in map, and call Change Key Color, which gets the array of keys, and an array of set colors, shuffle them and set color keys, ask if key(s) still exists, if they do, get the cylinder (handle of key) and create a dynamic material instance and set base color from getting the array of colors and it's color key index. If key not valid, get and set an array of the keys again. After both, the Color Key index is incremented then a delay of .5 seconds, then calling Change Key Color.
Moving Platforms- being with a 2 second delay before timeline begins, where the float sets speed of movement between the start and end made in platform viewport. Get start and end relative location, lerp between the two, with the timeline's float track connected to the lerp to guide movement, and returning the value to the set relative location code block, with the target being the platform (the parent). When timeline is finished, another 2 second delay and flip flop from the start to the end of the timeline to move platforms back and forth.
Falling Platforms- begin with saving starting location and rotation of the cube (Platform) with get world transform, if player is casted in collision box, platform begins the activate event. Boolean set-in place before Print String warns player with "!!!" and sets the material from grass to sandstone, a small 1 second delay before calling Drop, which sets simulation of physics, allowing the platform to drop from gravity, and setting the material to gravel, a longer 3 second delay in place before the platforms execute the reset code. Reset starts off with setting the platforms original location and turning off physics, setting the material to moss, then executing a the GoBacktoStart timeline which again smoothly lerps from the starting transform to the saved location of the platform on Even BeginPlay. Once timeline is finished, material is set back to grass.
Obtainable Objects (Health and Mana)- Tests for character player to overlap health's or mana's collision box and calls Try to Pick up. Once Pick up is called, Health/Mana is attached to character player's hand_r. If player clicks keyboard Q, Detach From Component is called and Set Simulate physics is turned on and collision is enabled all to remove item from player's hand. If player clicks Right Mouse Button, Print String +10 Health or Mana, and set the item in hand and call to destroy it.
Enemy- Testing if player is overlapped on Enemy box collision, If detected, set simulate physics on the head (parent) delay of 1 second before confirming the "KO" to player, and call Remove Enemy and Check from Enemy Spawner code, then destroy actor.
Enemy Spawner- on Event BeginPlay, Tell that the spawners are ready, and get an array of all present spawners, set the spawners and call Spawn Enemies Code, Which will call and do (For Each Loop) for each spawner, get their location and rotation, and call to spawn actors of BP_Enemy, then add to enemy total for each enemy spawned. Remove Enemy And Check (called in BP_Enemy) will subtract 1 enemy count from the Total, Branch tests if the enemies are all gone by getting the total enemy count testing if its greater that 0, if it is not greater than 0, then code continues with a Print string of "New Wave Incoming" with a delay of 5 seconds beofore calling the Spawn Enemies code again like the beginning.