A not so productive week with problems.
|
Hey there! During this week I haven´t got so much work done unfortunately since I have run into some problem with parts of my code evolving animations and this is pretty much what I have been spending my week on trying to fit it into our game. Since we for this course have changed library from SDL (Simple DirectMedia Layer) and are now working with SFML (Simple and Fast Multimedia Library) we can not reuse our old animation files since they would need to rewritten to adapt to the current. As this would not be an optimal solution to apply animations onto the program we would be better off to have new already adapted files that fits and works with SFML from the get go. Either if we write a new one, get a new from out teacher in the same way as we got the previous one or if we find one online that we can use for our game and implement it. If we take something from the internet we must be clear to say that we are using something we have not made ourselves and credit the ones who made it. After browsing the internet for a while I found a complete animation program on github from a link on SFML´s forum. Where the author gave permission for every one to use his code as long any changes made to his code was noted and stated that they were not from the original. (I currently uses Maximilian Wagenbach (aka. Foaly)). So I copied his code along with his credit note and created a new project containing this since it would shorten the time I would need to spend on either waiting for animation files from our teacher or if I would try to rewrite the old one. Now I had a program for it that was up and running in no time. I made a new project for this mainly for testing it and learning how it works before implementing it to our game project. Secondly now I had a program I could give to our artist so the before hand could try their animations and make changes if needed. This is one of our animations for our player avatar when walking and this screenshot is taken from the stand alone project and since it works my goal for the week was to actually implement it unto our game. This however was not as easy I thought it to be and have caused me a lot of concern this week and still continue to since it still does not work in our game. And the reason as far my searches have conducted is that I have a trouble in the animated sprite file where the draw function wont compile and it seems as such it is not draw able as a normal sprite. My first error was a rather simple one where I was trying to create a global variable but the program returned that it was unidentified variable even after I declared it and had a pointer to its class. However I had forgotten to make a forward declare for the class and such it did not know what it was, easy problem solved after my teacher pointed it out much to me embarrassment. My current problem is that the animated sprite class can not convert to a draw able (sf::drawable in the SFML library) and I can not call to its texture rectangle and get its size. This is problematic since I would like to reset its origin in order to have a smoother walking character that works better in relation to our enemies that will chase after the player. This is where I currently stand and I so far have not got any solution for this problem and will have to keep working on it asking around for help or something to point me in the right direction. So until next time have a good weekend and I will get back on this once it is solved. |
