Yay!! finally decided to write a second part. Well, you thought it would die in the first part? He he he, I am here to prove you wrong.
So after the first, I did a lot, but most were about figuring things out and trying out new functions for the game. It includes new animations, a power progress bar, action UI, etc. Most of my time was spent figuring out how to implement the slider bar to act as a power function.
So first let's get how the slider works. Basically while holding a button for a trigger, the slider keeps charging and once we stop holding then we get the required power. This will be later implemented to determine how far/hard we hit the ball.
To implement this simple function I had to go through a lot of trials and errors before finally arriving on one implementation. So basically what I did is first create the UI slider which is really not that hard. I just put a few circular sprites on the built-in slider and played with it a little. Then I have a trigger that basically sets the UI active once it is pressed. And as for the charging part, don't judge me, but this was all I could find using the Game Creator and I was too lazy to write an independent script just for this.
Yes, I literally created a for loop but with individual statements :/
I also have restarted the actions once it is all finished so the loop and go on forever. The loop only executes once the trigger is pressed, and every time the trigger is pressed, the SliderValue is set to 0 first. The SliderValue is a variable that stores the value of the slider. It is given by Game Creator's Slider UI itself.
And to make sure that the slider stops when we release the button, we have another trigger as well. The overview of the trigger is
And in the power reset, I hide the slider first and also cancel the actions for the loop so that it doesn't just keep on going forever. (This was pretty smart of me :))
As you noticed, I also set the ActionSelect active as well after setting the Slider inactive. The action selected is literally a UI that shows us the possible actions that can be done. It literally has five buttons (which can be made prettier later but it's working for now) and each button is a trigger for an action that initiates a state for each of the actions.
This UI literally appears after the power level has been selected and we can call the corresponding action.
And yes, I have already created four animations for four different types of shots in cricket (I just looked it up on youtube and tried to replicate it in Blender, which was really hard and time-consuming T_T . I really hope Mixamo becomes so big someday that it implements AI to convert videos into 3D animations. All Hail Mixamo). Yeah so let's not get into every little animation (As it is not that great either). Here is a quick look at how everything performs for now.
And in upcoming blogs, I don't want to get too much into the technical stuff but just explain how are things going and how I accomplished certain stuff or functionality. This will just be personal for me and help me focus on game development.
For now, here is how my hierarchy looks
0 comments:
Post a Comment