The timing is right!

Well this week started off pretty badly with me feeling like I’ve got a flu. It turned out to be a little bit worse when I went to the doctor and now I have to pop pills that make me sleepy and stay away from people so I don’t spread the illness.
This couldn’t have come at a worse time either right before the alpha for the game is supposed to be done.
Needless to say I’ve not got much work done this week at all.

But I’ve been trying to keep busy now later in the week and will probably work on things I’ve missed during the weekend.
But today I’ve been working on the timer for the game it will be a part of the HUD so that you can see how long you’ve been playing.

Image

This is an example of the ingame HUD made by Ahmad Ali
The making of the timer started with me reading up on how and with what “tools” to do this task.
But I quickly ran into problems while making this at first I tried to use the sf::clock class which is not ideal for what I wanted to do. Instead I use sf::time which got me further along but soon enough I had a new problem which was how do I get a float into a string.
Float in a string.At first I simply tried to brute force it in there by just trial and error but after an hour or so of doing that. I decided to call up a friend who had apparently done this already and there is a built in function called “std::to_string()” this seemed to work.

But after I thought I was done with the timer and started the game up I saw to my dismay that it didn’t work.

And I will continue with the work on the timer into the small hours of the night today.

What’s still needed and planned for the HUD.

  • The currently held weapon or the noise maker. (The noise maker will be a two way radio that you can throw and it will attract the guards to it.)
  • If you are in possession of a key card or not that allows you to open locked doors.
  • And if you are carrying the mission objective a file that contains the secrets that you are after.

These will be pretty simple to add onto the game since it will just be different if() statements that say you can pick up the item or if you already carrying something in that slot.

 

2 thoughts on “The timing is right!

  1. It is like you say that your illness had a really perfect timing, but that´s the irony of life, isn’t it?. Nice that the HUD is coming along! Like the look of it, hopefully you can make it work as well. I really hope that you can proceed your work this week without any bigger interruptions! Good luck!

  2. For once I see a blogpost with somewhat organised structure, keep up that good work!

    I should also point out that there is no real need to notify us about your illness, since it is not related to your artefact. Though it can shed some light on why the artefact is not done, but still it feels a bit off.

    I would also like to see some sample code, pseudo-code is okey if there is no finished product. Just so that I can get a hunch of what is going on, it makes it a lot easier to follow your train of thought.
    Also, why was it better to use sf::Time instead of sf::clock?
    How does that apply to the time?
    How do you know how much time has passed since the game started?
    Does it reset when you die and respawn? (implying that you have a respawn feature)
    Also if you have problem getting a float value into a string, here is a generic way of converting different types to string and vice versa: http://www.cplusplus.com/articles/D9j2Nwbp/

    When you say that it did not work, what was the error? If you write your error messages and put some sample code in your next post, chances are that the person reading it have encountered the same issue and is able to help you out.

    Well other than that I do not have anything else to add, good luck on your future artefacts!

Leave a comment