2014-03-14 Fifth Artifact

Hi again

This week I have been focusing on two things, the first thing was to create the startmenu partly codewise and partly graphicwise (which have been really fun and exciting to me as a former art student), the second thing was not really planned but while working with the startmenu I noticed that it was time to re-scale everything to fullscreen. After talking with my group about it I was set on the task to do this, and it have been a lot more work than it seemed like at the beginning. In this post I will give it a shot to explain what I had to do to scale up the entire game.

ImageA mouck-up of what the StartMenu will look like (with some of the real sprites).

First step towards making the game run in full screen mode was to actually set it to full screen mode by setting the VideoMode sf::Style to Fullscreen in our Engine.cpp. Makes sense, right?

 However, what happened is that everything was stretched out and looked awful, of course. So then I created a folder for our new resolution sprite sheets (and put them in it) in our data folder for our project and named it like the previous folder, but with a number afterwards. This meant that I only had to put the number in the name of our old folder within our code in order to make it look for the sprite sheets at the right place.

ImageThe folders.

Then I had to adjust the in-game camera (or view) to the new measurements. This was slightly troublesome since it was a long time ago I created the camera, and I did not remember where I had put the functions that I now needed to change and how many they were. Luckily I just had to change it in two places – the origin for the camera which is the middle of the screen, and the size of the view. At first I missed out on changing the later mentioned variables, which really messed up the in-game look. But after searching for a while I found the error.

After this I had to adapt the animation code to the new sprite sheets meaning I had to change the numbers of width and height on each sprite, and the coordinates from which the program will read the frames. This was not very hard but it took some time since I had to change the things at pretty many different places. I also did some wrongs a few times, making the “walk right” animation play when walking left and the same for the opposite as an example. But those errors was easy to correct since it was just to switch places of the numbers.

Then I had to adjust the coordinates for the player collision in the horizon and at the end of the game screen, and on what coordinates some objects were to be drawn at (mountains in the background as an example).

I am not completely done yet with converting the game into a full screen one since we still miss bigger versions of some of the sprites and so on.