Posted March 16, 2021 by DinoSage
#Sliding
Hi! Welcome to my fifth post! If you have not read the previous posts, I highly encourage you all to skim over those first to get a gist of what I have been doing so far! This post was late by 5 days, and I am terribly sorry for the delay. I wanted to make some actual progress that I can show for my game, and that is exactly what I did! Except, on Sunday, I was trying to mess around with Git & Github, and let's just say that I lost about 1/2 of my code for the new feature that I had been working on. Note: I did NOT lose 1/2 of all my code, just 1/2 of the code for the new feature, which will be explained below later. So this post was delayed an additional day as it took me the rest of my Sunday to recover it. Also, this post will have no pictures to sort of build up a little hype about my game trailer, which is coming soon I promise!
A short recap of what I accomplished- the sliding feature. That is pretty much it. I did finish the code-rework, along with some additional code management. I have to look at the future too a little bit. Learning on good code management as I go. But you guys aren't here to read about my code rework, making my code look pretty and more useful in the future yet have absolutely no effect on the game at that time. Right? And so, to not make this a code-based post like last time, I actually made a noticeable change. Believe it or not, this is actually one big feature to add to the code, yet it may not look like it from a viewer's point of view.
Again, the name should be pretty intuitive for what it does. Now, the player of my game, Agility Rush, can now slide in addition to its jump and fall actions! Originally, the player tapped the screen to jump and tapped it again to fall back to the ground. Now, while the falling stays the same, the user must drag up to jump. And if the user drags down? Well, obviously the player object will slide! Now, what does all that entail?
Well first, I had to change my input system to start reading drags and to differentiate correctly between drag up and drag down. Then, the problem came with how to make the body slide. Now, instead of sliding, the player actually "shrinks" in a sort of way. The cube will because a small rectangle that has the same width, yet 1/3 of the original height upon the screen being swiped down. Currently, to exit this state, the user must swipe up, which will make the cube both un-slide and jump at the same time. Right now there is no "time-limit" to the slide, meaning it will not automatically uns-slide after a while.
That pretty much wraps up the sliding feature at its core.
Just kidding! There's more to the sliding thing overall. Now, being able to slide is useless if it isn't necessary to slide at any point in the game. And thus comes to existence: The Sliding Obstacle! The sliding obstacle is simply like a regular obstacle, a rectangle, that stretches from the top of the screen to the ground, except for this small gap in between the ground and obstacle. This small gap is not big enough for the regular cube player to fit, however is just big enough for a sliding player to fit through.
After the sliding obstacle, we now have 2 obstacles: one that the player must jump over, and one that the player must slide under. That feels very limiting though. And so, I added a third obstacle, the Jumpable / Slidable Obstacle. In short, this obstacle has the same gap size as a sliding obstacle, however, it does not stretch up to the ceiling. It is short enough for the player to jump over it. This means that the player can pass through the obstacle either by jumping or sliding. However, doing nothing will result in the player dying and therefore ending the game (GAMEOVER).
Don't forget everyone, I have a milestone set to publish this game by the end of March. Currently, we have 11 days yet. And believe me, a lot is required before the actual polishing. And losing some of my code set me back a bit as well. Below is a list of my plans and goals before the milestone. The goals below are organized by priority making the top most important and bottom least.
I have also been experimenting with a software called Hyperlap2D, which believe me is great! However, it is in its very early release stage, and thus has a lot of changes that need to be made.
That wraps up my blog post for today! Of course below this will be the links, sources, and credits (or simply mentions) for this post and my game in general. Hope you enjoyed this post, please follow my devlog, read my earlier posts if you have not already, and please leave any comments and questions you have. I would be happy to answer them!