Spaghetti Harakat
|
Today I worked on the game’s Harakat (Arabic for ‘movement’) mode and the HUD for the prototype. As it turns out, the Unreal engine has excellent functionality for creating both of these. We’re creating a slow-motion effect by running a console command when both sticks on the gamepad are pressed at the same time. There is a health meter and a harakat meter which responds to the current player values, the harakat value is used to determine if the player can activate harakat mode and how long the player can stay in it. When the game is functional the player will be able to enter harakat mode and then perform movements using the sticks to cast and combine different spells, these spells are displayed on a separate HUD which only appears in harakat mode. The most tricky part was setting up the inputs to only be registered if both sticks were pressed at the same time, what i did in the end was set one bool to each stick which was set to true when the stick was pressed. It was then set to false after a short delay for margin when the stick was released. Both paths check the other bool and only proceeds if both booleans are true, this way only the second input will go through and multiple instances of the effect won’t be a problem down the line. The function then checks if the meter is filled and only proceeds if it is, I could have checked this earlier but that would have meant checking twice which i assumed was less effective. It then executes the console command slowmo 0.1 which reduced the in-game time’s speed to create a slow-motion effect. It also sets a boolean called inHarakat to be true which in turn causes the harakat meter to decrease. When the meter is empty the console command slowmo 1.0 is called and inHarakat is set to false. Also to be noted it that another HUD object is created which right now includes a couple of symbols to represent the different spells and corresponding motions. For the next goal, i will need to figure out a way to read the player’s inputs from the analogue sticks and convert it into a movement which can then be assigned to individual spells. |
