Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Seim2k

Pages: [1]
1
Hi,

somewhere i read you shouldn't use scale, but setScale(x,y). You could also check before you flip and don't set the scale in every timeframe.

In my project i did st like this (it' s also executed in an update loop)

void SpritesheetAnimation::flipAnimationLeft() {
    if (mSprite.getScale().x != -1) {
        // do not ever use mSprite.scale({x,y}) !!!
        mSprite.setScale({-1, 1});
    }
}

void SpritesheetAnimation::flipAnimationRight() {
    if (mSprite.getScale().x != 1) {
        // do not ever use mSprite.scale({x,y}) !!!
        mSprite.setScale({1, 1});
    }
}
 

And at the appropriate location in the code:

    if(event.type == sf::Event::KeyPressed)
    {
        switch (event.key.code)
        {
            case sf::Keyboard::D:
            case sf::Keyboard::Right:
            {
                playerCharacter->handleInput(EInput::PressRight);
                playerCharacter->getSpriteAnimation().flipAnimationRight();
                playerCharacter->setMoveDirection(EMoveDirection::Right);
                break;
            }

            case sf::Keyboard::A:
            case sf::Keyboard::Left:
            {
                playerCharacter->handleInput(EInput::PressLeft);
                playerCharacter->getSpriteAnimation().flipAnimationLeft();
                playerCharacter->setMoveDirection(EMoveDirection::Left);
                break;
            }
 

2
SFML projects / Re: Nero Game Engine
« on: June 21, 2021, 12:57:26 pm »
Hi  Sk Landry,

thanks for the info. I'm looking forward to it and pherhaps i'll try it in Windows.

Best and keep on ! You do a great job!

Seim.

3
SFML projects / Re: Nero Game Engine
« on: June 19, 2021, 03:29:41 pm »
Hi Sk Landry,

I read through the Thread and it's awesome what progress you made. This is a really cool project. I want to try it out. Can you tell if and when a Linux version will be available?

Best,
Seim.

Pages: [1]
anything