Thursday, 5 July 2012

Day Four: Health Potions and Keeping Healthy

So its day four and I am still putting these out, I never though I would keep to writing a post everyday but it seems to be working quite well and as intended I am certainly getting more done know I have to sit and write about it everyday.


I started today where I left off yesterday, wanting to read some tips on testing code. So this is what I did this morning, and I found some interesting posts about testing but a lot of what I read referred to finished releases of programs rather than testing as you go. This started to make sense to me as every time I work on my program I seem to change something I had previous thought was fine. Therefore testing a finished product will allow me to make a list of criteria I directly test parts of the project when I have a better idea of the bigger picture. I will also need to take an in-depth look at unittest something I looked at today but was very confused by it, but no worries I will try again at a later date.


Ok, so as far as tasks for today I thought it was time to get started on adding useable items to the game and a bag to keep track of the items the player finds. A good item to start with was the health potion and along with this an action point potion to restore AP of the player as this would have very simular functions to the health potion. So, I started by making a bag object this will track the number of potion and in future have slots of items like weapons and armour found in the game. In the bag class I then made functions for using the items, this was to deduct the amount in the bag and then return the value of the amount of points to restore to the player.


It was around this time I went out to do my seconded paper round. When I returned I wrote code to allow the player to access the bag during battle and use the items I set up. I made this a battle bag function as it will be different to the full bag I will add out side combat, this bag will only show items that can be used in battle. This makes it easier for the user as in some games it will list all the items and then only once you click on the item it warns you it can't be used in battle. This finished up the potions, I checked it all worked then committed it to my GitHub.


Then it was time for me to get back out running, and today I had a plan for training my weakness, hills. On my usual run there is a medium sized hill towards the end of the route back to my house, this is something that is very unavoidable in Wales. So today I took a light jog to the hill and set my Nike+ app for 2 km and ran to the top and then back down. I did this until I had run the full 2 km then I ran back to my house. During the session I maintained a steady pace as I was also controlling how I descended from the top as well as pushing myself on the asent. I was pleased with how I did and next time will aim to do longer so I can finally concur the hills.


So its time for final thoughts again, I would say today was great, I work very effectively on implementing the potions so I feel I am gaining a good understanding of what I am leaning so far. I also a had an excellent workout on the hill and can't wait to see how I fair against it come my next run. Looking forward into tomorrow I think I will start to add item drops form killing the mobs so the player can find the potions and then I think I will start listing some cool items to add to the game as well as working out how the player will then equip them.


The quote I going to use today is personal favourite of mine from one of my inspirations Steve Jobs, the quote I think is very relevant to this proses:
"For the past 33 years, I have looked in the mirror every morning and asked myself: 'If today were the last day of my life, would I want to do what I am about to do today?' And whenever the answer has been 'No' for too many days in a row, I know I need to change something."
As always the progress I made today can be found on my GitHub and as always you can follow me on twitter @CDSteer I will be back tomorrow with the last blog of the week.

No comments:

Post a Comment