Unnamed Fish Game BloggPost 3

Today I ran into some issues while trying to modify the code from the Platformer project we got during last course. The problem occured as the old code used SDL, and the new project is using SFML.

The issues I ran into here was that the Sprite works differently in these libraries, as of the SFML has one included and in SDL we created our own, This made several of the parameters for the function in need for change. as of now I still have not solved this completely. This also had some fun effects on how the drawing of the sprites was done.

Something that also made this more difficult is that the Level.h /cpp I’m trying to get working is depending on a SpriteManager that itself is dependant on a DrawManager, GameObject, GameObject manager and last but not less important Collider. These are all made by the other 3 programmers in the group, and by the Level will be the first time all of them are put to use at the same time.

The code itself looks like this for the part mentioned


//Sprite
sf::Sprite *sprite = p_pSpriteManager->Load(m_SpriteMapFileName, c.x, c.y, c.w, c.h);

sprite->setPosition(iX,iY);

// Collider
Collider *collider = new Collider;
collider->m_position = sf::Vector2f(iX,iY) ;
collider->m_extention = sf::Vector2f(c.w, c.h);

// GameObject
GameObject *go = new GameObject(sprite->getPosition(),sprite,collider);
go->SetPosition(sf::Vector2f(iX,iY));
m_GameObjects.push_back(go);

In the current state it looks something like this.

Level draw

The space the sprites should occupy seems to be correct, but the texture is not. As I’m looking into it I can’t seem to find where things go wrong.

The group also have had a meeting with Adam Mays, where the focus on what we should be doing shifted a little bit as we had two goals going against each other. Aparenly having a game that is meant to be Stressfull at the same time as we also called it Exploration was not a good combination. So after this meeting there is now more focus on the Stressfull part and the Eating Mechanic to make it good.

Hopefully this will go as planned, at least it feels like we are taking some good steps forward.