|
There isn’t much I can write about this week, since I got a sudden call this Tuesday. I’ll be taking the ferry back to the mainland tomorrow afternoon, I’ll earn some money from it and the traveling expenses is being paid, I couldn’t really pass up on that now could I?
During the last weekend and into Monday, I’ve been working on the Collision Manager, Unlike the first version of the collision manager that took 2 arguments (position and radius), the new one takes only 1 argument, a sf::Sprite, since sf::Sprite contain the position (as well as means to calculate the center of it, which is the previous position) and the variables needed to calculate the radius to the furthest point in the rectangle (one of the corners). The only exception is the collision with furniture that also has the Furniture as argument. Unlike doors, you can collide with two or more different furnitures at the same time, so they can’t return the object it collided with (it won’t check the collision on the objects after it).
After looking into DoorManager and showing it to our Producer, Henrik ”Stickan” Forsman, asked if the use radius of the doors could be similar to the keys use radius (declining intensity), and after looking into it, I decided that it would be easily done if I just used the same principle as with the key; pre-rendered light using the Light Engine, as shown in the picture below (it’s a little hard to see since the light is still kinda disturbed on Mac)
The rest of the Monday and Tuesday I’ve been working on the GUI (or HUD, we can’t seem to decide what to call it). As you can see in the Picture above, the key up in the right corner is the same colour as the door’s light. As I mentioned in my earlier post, the keys and doors are connected by sharing the same colour, this not only gives a wide variety of keys we can use (16 777 216 different combinations to be exact), but also provide an easy way to connect the colours for the player; a player wouldn’t try to open a door with red glow if he only has a green key.
There is a lot of different distinguishable colours that we can use: Red, Green, Blue, Cyan, Magenta and Yellow, just to name the colours RGB and CMYK use, the former commonly used in technology (where the light is emitted) and the latter for printing (where light is reflected). SFML, as many other libraries, use RGBA (A standing for Alpha, which is opacity).

|