Basic “Coin Collection”

So, we got tasked to make blog posts during our course and since I’ve never made a propper blog post before here goes nothing.

 

I’m going to be honest and say that I haven’t gotten much done this week due to the fact that I’ve been laying in bed with a fever, however this doesn’t mean I haven’t gotten something done.

The artefact I’ve created and decided to write about this week is what I’d like to call “Basic Coin Collection”, a core element to the game we are creating. So in this game, called Trowl, you play as a owl mother who lives on a train. When the train starts moving the owls nest blows away and scatter the mother and her babys over the train. The goal of the game is to collect all the owlets and bring them to safty. So while the player doesn’t actually collect coins the basics are still the same, find the owlets and pick them up. Not only does this increse the players score but is key for the players survival throughout the game. Instead of having a health bar or a time to complete the game in, the player have a “stress bar”, a sort of reverse health bar. Over time the bar will fill up and once it’s full the mother becomes to stressed to continue and the player lose. Here is where the survival part of the collecting comes in, when the player picks up a owlet the mother calm down a bit and reduces the stress meter, giving the player some more time to finnish the game.

owlet

Due to the nature of SFML and some small systems created by both me and my group members, getting the “Coin Collecting” part of this artifact done was suprisingly easy. Once I got the sprite added into the game I could easily get the size of it by asking for the sprits FloatRect width and hight, I then used this together with a small collision system and checked if the player collided with the owlet and if they did I changed the owlets state from idle to non idle. Currently there isn’t really a non idle state for the owlet since we just wanted to focus on getting the collection part done before the alpha so the owlet just turn invisible when picked up, however it will be following the player in the end when you pick it up. The state the owlet is in is controlled with a boolean, meaning that either it’s idle or not. Easy to check and easy to work around.

We weren’t satesfied there though. After all, it’s a little baby bird. A living, active creature, not a static object so obviously we wanted to show that, so I made it waddle around. The way I did this was with one int that was either 1 or -1 and controlled the direction of wich the owlet is moving and facing and a float that act as a timer and after it reached a certain value it zeroed it self as well as changed the value of the int to either 1 or -1.

To make it look less stiff I did the exact same thing for rotation, however with a much shorter timer, to make it look like it waddled around.

 

So to recap.

I’ve worked on a core element of our game wich I’d like to call “Coin Collection” however instead of static coins I made waddeling owlets. I did this by checking if the player collided with a owlet, using simpe collision detection created by another group member, and then switched the owlets state wich at the moment just turn the owlet invisible. To make it look more alive and not as static I also made it waddle around.

One thought on “Basic “Coin Collection”

  1. After have read through your blog it isn’t much that I can say than Good Job!

    From a viewpoint of a student who is fairly new to coding I think that you have communicated your reasons and thoughts on how and why you have settled on the choices that you have made in a way that is understandable and reasonable in a designing standpoint. Making a game where you are playing a mother of owl babies you need to feel that the creatures that you have to save are somehow alive and vulnerable, that is a key feeling that you have to express visually. This, I understand by reading your text, is something that you have addressed in a way that I believe is very intuitive and sensitive to the experience playing the game.

    I have tried to think of a compliment to the work that you have done but in my viewpoint I can’t say anything that you could have done better. You are straight forward in your explanations of how you went about in coding the artefact and you have communicated your reasons for every decision you have made.

    I look forward to see what the end product of your game will look like.

    //Peter Camerini
    //Group 15
    //[5SDO33]

    Like

Leave a comment