So another week down in the dust. I'm sad to say that this week hasn't been as progressive as I would have liked. I had been wracking my brain for half the week finding out why my 'Puncher' traps weren't overlaying correctly. I took me ages to realize that I was comparing the point of impact to the 0, 0 point of the players location, rather than the 0 + height of the players location... Yup, I feel pretty silly right about now... But! no matter, I feel it was a mere oversight on something so simple... Ehem, anyway, moving on!
So This week I have implemented a new Mechanic called... Well, I don't really have an actual name for it yet, but I will. For now, I'll refer to this as 'Window of death'. Basically, this window of death pops out of the wall, revealing a cannon of sorts. The cannon is set up to randomly shoot either electricity or fire. I've only set up the electricity so far, so hopefully next week, I'll also have the fire implemented.
The components of the Wooden window of Death.
Now, I know there are still a lot of kinks I need to iron out such as deciding how to overlay the electricity. Maybe I separate the actor into small components? I'm not sure at this stage, but hopefully I will figure it out.
Welp! That's about it for this week. Hopefully I have a bit more to show you next week. Until then, thanks for reading!
So this week has been interesting, if not, frustrating. Before I explode your minds with the issues I have been having, let's just take a step back and enjoy the little victories. Firstly, I've managed to implement a few small 'juicy' elements for the 'Puncher' as well as adding a few more animations to the character. The punch effects where fairly simple to implement.
Firstly the dust clouds. To increase performance, rather than creating two different dust clouds (one for left, and one for right), all I did was create two of the same actor, and just flipped one -100% along the horizontal axes.
As for the camera shake, less is more, too much, and it's over kill. Playing with the subtle amounts really worked for me to find a happy value.
I had also create some simple death animations which I would really love to push throughout this game. I feel that having funny deaths of a character gives the game not only personality, but some moments as well. Death animations really take me back to 'Crash Bandicoot' days, so implementing something like that would really top it off.
The first death animation implemented was for the 'Puncher' mechanic. If the player was in a certain location above and below it's starting location from when the puncher trap impacted, the player would die.
This was actually quite tricky to set up. Firstly, I needed to check whether or not the player was roughly around the area where the 'Puncher' impacted, otherwise, the player would still die even if it was a lot higher up since it still technically 'collided' with the trap. So, I needed a reference point from where the player characters X, Y coordinates were when the puncher trap first spawned. Then once the trap fell to the impact point, it checked whether or not it collided with the player's top collision point, as well as checking whether or not the player was still in that same location.
The other problem I was having was the player essentially had to stand still in order to die. So i had to widen the 'touch' location, so then if the player had moved slightly up or down, then the collision would still happen (roughly 20 +/- in the Y direction from the original location seemed like a sweet spot).
Basically, whether I moved slightly or not, I would die if I didn't move completely out of the way.
So once I had a grasp of the 2D-flat-detection-collision-location-stuff, it was finally time to move on to something fresh. A new mechanic! I created the 'Buzzsaw'! I viscous saw-blade which pops out form the ground. The... only... thing I still need to do with this is to actually get it to work... Which is on my to-do list! I still need to implement a death for that, as well as make sure it constrains to the boundaries of the game environment. Easy fixes, but ones which still need to be done. Also, let me know what you think about the colors; will they stand out, will it be funny enough, or whatever. Let me know!
After all this success, reality had to come back for another round. There was still something that was 'urking' me, and that was the layer ordering of each asset. What's that you ask? Welp, essentially layer ordering (or z-layering for short) is a type of thing needed to move an actor or image up or down within a particular layer without adding a crazy amount of new layers. The problem with this was that each asset within the level moves. And this being a 2D game, with basically zero 3-dimensional space, was quite difficult to figure out. Trust me, I spend ages on trying to sort out when and how these assets should work with layering. I did however manage to find a useful resource which helped understand how I could approach this. Now, without going fully into technicalities, I'll try and explain the process:
I firstly had to make an array (or list in my case) which was empty.
Then, from that list, I had to identify each actor within the layer I wanted to affect
I needed to add that actor to the list, and if it was the first actor added, then be done with it. However, it this wasn't the first actor in the list, then i needed to create a 'zIndex' attribute (integer variable)
I also needed to check each actor in the list before it and check whether or not it was lower or higher in the Y axes (Up axes).
If it was a higher value, then do nothing, but it was lower value, then decrease the Zindex by one for each actor in the list.
Then finally, insert that new actor into the correct index within the list.
And since each actor moves all the time, I needed to have this in an updated event.
Yup, fun. But I eventually got there. There are still a few tweaks to push out, but it is working at a fairly good point.
Overall, I'm pretty happy with this progress. I'm hoping by the end of this week I will have the Z-Layering under control, as well as the Buzz-saw mechanic.
That's about it for this week. Stay tuned for more next week!
Enjoy, and thanks for reading.
It's that time again for another installment of "Hey something worked!... Oh wait, never mind..." with yours truly. This week I've been quite busy with reapplying all of the character animations, as well as implementing the first game trap mechanic. Below is the final result of my character animations. To be honest, I'm pretty happy with the result, but, early days still.
Once I completed the animations, I then moved on to tweaking the controls a little more. I added my own joy-stick display to make it even more transparent and less intrusive. I also made it so that if the player touches the other side of the screen, then the controls will appear on the opposite side instead. I made this decision so that the controls aren't always locked in one location, and that any player, left or right handed can enjoy.
Then lastly, it was time to add in the first mechanic: The Puncher. This deadly trap will flatten you like a pancake if you are not careful. Yes there are a few kinks I still need to remove from this trap, but the overall idea is coming along nicely.
That's basically it for this week. Hopefully I will have a little more to show you all next week. I do however head back to work, so it may not be as much as I would like, but hey- a man's gotta eat!
Until next week!
Another week down, and I must say, I have managed to get through this section fairly quickly, thanks to Spine2D. Very useful tool when animating in 2D. It has saved me countless hours of key-by-key drawing. All I really needed to do is draw up each section of the character in all direction, and let spine2D do the rest. Now, I know you must be thinking that I'm a promoting powerhouse, but seriously, I'm glad I choose this route. I would suggest, if you are working on a game which uses a number of 2D animations, I would highly recommend using a program such as Spine2D, super useful.
Really, the only confusing part was knowing when to use 'Left-Up-sword' and 'Left-Down-Shield' for this guy. Word of advice; Always label your sprite sheet assets as clearly as possible, my god! The amount of times I used the wrong asset was incredible. There's really not much else I can say for this particular phase, All I really did was break apart the character into it's own components, named them as best as I could, and put them together.
So yeah, super quick devlog this week, But I really would like to add a few more key frames in each of the animations for the coming week. I also plan to start implementing the actual game mechanics such as a few of the basic obstacles, and traps. So stay tuned for more!