Welcome back to the dev bog! Let’s wrap up September, shall we?
Last week I added color differentiation for the different note values, and this week we’ve got another new feature: Holds! You know, these things over on the right.
So these are pretty easy to detect in the simfile. Instead of a 1 in the note data, which indicates a regular arrow, you’ll encounter a 2, which indicates the beginning or “head” of the hold. Later on, you’ll encounter a 3, which indicates the end or “tail” of the hold. Rolls from ITG are actually implemented the same way but with a 4 instead of a 2 signifying its head.
Getting these things to show up correctly might not sound too challenging, but it has been surprisingly complex. First things first, when generating all of the arrows, I need to keep track of which heads have been opened so I can be on the lookout for their corresponding tails. When I find a tail, it and its tail are “connected” with each other by storing each other’s id values in some variables.
Next, I had to prevent heads from being destroyed like regular arrows are. In the real game, arrows that are hit are destroyed instantly, and those that are not eventually scroll off-screen, where they will be destroyed. Currently for testing purposes, all arrows just get destroyed once they cross over the receptor. So I had to add some code to make the heads “stick” at the receptor until the tail gets destroyed. That way we don’t have tails without heads.
Finally, we have to connect the head and tail graphically. Admittedly, I couldn’t get this working quite the way I wanted in time for this dev blog, so I settled for something much more basic in the meantime. In the final product, a sprite will be tiled in the area between the two arrows, but for now just a rectangle is drawn to represent the hold “body”.
Let’s finish things up with a video. Decided to switch my test song because I was getting a bit tired of hearing Valkyrie Dimension all the time. For those interested in just the holds, skip to about 0:55 for a good example.