Thursday, 15 October 2015

Day 22: "Health-y" Amounts of Progress

     Today I decided to continue working on the custom health bar that I started a while ago. I finished the main looks of the bar ( which can easily be changed if needed ) and I also started to make the 101 sprites that I need to show each possible value of health that the player can have, ranging from 0 to 100. I also came up with some possible code that could be used to cause a critical hit. Here's an idea of how that works:

In obj_Player

event collision with obj_Zombie

var crit = random_range(1,50);

if crit>=45 && hit=0{
health-=random_range(15,20)
alarm[1]=10;
}
else if hit=0{
health-=random_range(5,10)
alarm[1]=10;
}

      Basically this gives the zombie a 10% chance to get a critical hit on the player, dealing high amounts of damage. This percentage can be tweaked later on if it feels like they occur too often. Now I haven't exactly tested this critical hit code yet, but the game doesn't crash when trying to use it, so that's a good sign. Noticing a critical hit by the amount of damage it takes off should be pretty simple, but it would be alot easier to do something like drawing text on screen whenever it happens just for reassurance that it is working.

     Today I also helped Simran to get a new version of the game to work with, which proved somehow to be a bit of a hassle. I managed to get a copy of the game working on his computer, but I had to take some huge actions in doing so. Quite recklessly, I decided to save a single copy of the game I was currently working on to my desktop, and deleting the rest of the items in my dropbox folder, while also clearing out his folder. I then copied the save file from the desktop to both my folder, and his own, so that we both had the absolute latest version. I noticed much later at home that my game was having some problems, in the idea that it was crashing whenever I tried to run the game. I noticed that somehow, I had lost all of the fonts that we had created, which wasn't really a huge loss, just about a five minute fix. However, I soon after noticed that all of the backgrounds and tiles were missing from the game as well. I don't know if this was caused by a syncing issue with dropbox, or if I missed the files when copying and pasting between folders. Either way,  I can just retrieve a copy of all of the backgrounds from Justin or someone else and import the files into my own copy.

     I learned two important lessons in all of my work today. In creating the health bar, I learned it can be very tedious to make custom health bars, if you are going about the way of just making a hundred different sprites to represent each different health value. I am  even able to think of simpler ways to make this alot easier now, but I am a bit too far into this to want to quit now. What was suggested to me was to make the text a separate thing, using it's own font and object and whatnot, the problem being that the health bar itself would not be updating the visual representation of the health itself. Since I am just making the empty parts of the bar pure black, what could be done is just drawing individual sprites over top of the health bar that make it appear as though it is going down, when really something is just being put over top of it. I may try adding this into the game if I have the time to do so. It will take less work for making sprites, but it will also save a fair bit of coding that I will have to add in as well... both sides have their flaws.

     I also learned that I should probably be more careful with my files. I may have only lost the backgrounds and fonts this time, which was not a huge loss, but I could have lost alot more in the transportation of the files throughout multiple folders without keeping a backup. Something to keep in mind for next time I guess. Tomorrow I will be continuing my work on the custom health bar, and hopefully making a fair bit of progress there. I hope to get to at least 50 health tomorrow, but I don't know how long it is going to take to finish that.






No comments:

Post a Comment