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 - Pallevante

Pages: [1]
1
General / Re: SFML-2.1 VS2013 Release build slow/not working outside VS.
« on: January 14, 2014, 10:28:22 pm »
Yeah I'm trying to get a good minimal compilable example up. The game is already minimal as is.

2
General / Re: SFML-2.1 VS2013 Release build slow/not working outside VS.
« on: January 11, 2014, 09:11:50 am »
I've tested to send the program to my friends and they same it's about the same fps one however said it was on 64 once.

But why would a locked fps make so much issues like sometimes everything goes in slow motion or other times it works fine just that you can't shoot as fast as you should.

3
General / Re: SFML-2.1 VS2013 Release build slow/not working outside VS.
« on: January 10, 2014, 10:41:46 am »
I've made the fps counter and it says about 57-60 fps at all times.
I've yet to encounter the blackscreen glitch and just the one with me being able to move as usual but not fire.

4
General / Re: SFML-2.1 VS2013 Release build slow/not working outside VS.
« on: January 10, 2014, 09:57:41 am »
So I don't see any calculations to take the framerate into account. Are you just assuming that the application runs with a certain FPS? Because that's not a good idea.
You could work with a simple delta time or implement a fixed time step.

I actually lock the game to 60 fps when main calls the constructor for game shown here:

Game::Game() :
mPlayer(new Player(400, 300)),
mEnteties(), //Initiate the vector.
mScore(0)
{
        window.setFramerateLimit(60);
        mEnteties.push_back(mPlayer);  
}

Can you provide the your general update loop?

void Game::run(){
       
        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {              
                         if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)
                                 || event.type == sf::Event::Closed)
                    window.close();                      
                         
                }
       
                window.clear();
                spawnEnemies();        
                tick();
                detectCollisions();
                killEnteties();
                renderImages();
                renderScore();
                window.display();
        }
}
 

5
General / Re: SFML-2.1 VS2013 Release build slow/not working outside VS.
« on: January 10, 2014, 09:42:22 am »
Ok good think the errors weren't important! :)

I have 3 movement codes. One for player, one for enemy and one for bullets.
All of them are subclasses to Entity which controls the move functions.


void Player::move(){

         if (sf::Keyboard::isKeyPressed(sf::Keyboard::D)){
                 mCircleShape.move(mSpeed, 0);           
         }
     if (sf::Keyboard::isKeyPressed(sf::Keyboard::A)){
                 mCircleShape.move(-mSpeed, 0);

         }
     if (sf::Keyboard::isKeyPressed(sf::Keyboard::S)){    
                 mCircleShape.move(0, mSpeed);

         }
     if (sf::Keyboard::isKeyPressed(sf::Keyboard::W)){
                 mCircleShape.move(0, -mSpeed);

         }

}


void Enemy::move(entityVector &mEnteties){
        sf::Time checkUpdateDir = updateDir.getElapsedTime();

        if (checkUpdateDir.asMilliseconds() > 350){

                for (entityVector::iterator i = mEnteties.begin(); i != mEnteties.end(); i++){
                        Entity* enteties = *i;
                        if (enteties->isPlayer()){

                                float x = enteties->getX() - getX();
                                float y = enteties->getY() - getY();

                                mXDir = x / sqrt(powf(x, 2) + powf(y, 2)) * mSpeed;
                                mYDir = y / sqrt(powf(x, 2) + powf(y, 2)) * mSpeed;
                               
                        }
                }
                updateDir.restart();
        }
        mCircleShape.move(mXDir, mYDir);
}


void Bullet::move(){
        mCircleShape.move(mXDir, mYDir);
}


 

6
General / SFML-2.1 VS2013 Release build slow/not working outside VS.
« on: January 09, 2014, 10:11:25 pm »
I made a game with SFML and when I debug it, it works perfectly and when I launch the debug exe outside Visual Studio it also works.

When I build for release and test it it works but not outside Visual Studio. 1/6 times I can move around like I should but not shoot as I should.

Worth mentioning is that visual studio builds it and posts 6 errors  but I can run it anyway.

The errors I'm getting are these:

   1   IntelliSense: no instance of constructor "sf::ContextSettings::ContextSettings" matches the argument list   f:\Program\Dropbox\Programmering\Biblotek\SFML\SFML-2.1\include\SFML\Window\Window.hpp   89
   2   IntelliSense: no instance of constructor "sf::ContextSettings::ContextSettings" matches the argument list   f:\Program\Dropbox\Programmering\Biblotek\SFML\SFML-2.1\include\SFML\Window\Window.hpp   105
   3   IntelliSense: no instance of constructor "sf::ContextSettings::ContextSettings" matches the argument list   f:\Program\Dropbox\Programmering\Biblotek\SFML\SFML-2.1\include\SFML\Window\Window.hpp   128
   4   IntelliSense: no instance of constructor "sf::ContextSettings::ContextSettings" matches the argument list   f:\Program\Dropbox\Programmering\Biblotek\SFML\SFML-2.1\include\SFML\Window\Window.hpp   141
   5   IntelliSense: no instance of constructor "sf::ContextSettings::ContextSettings" matches the argument list   f:\Program\Dropbox\Programmering\Biblotek\SFML\SFML-2.1\include\SFML\Graphics\RenderWindow.hpp   76
   6   IntelliSense: no instance of constructor "sf::ContextSettings::ContextSettings" matches the argument list   f:\Program\Dropbox\Programmering\Biblotek\SFML\SFML-2.1\include\SFML\Graphics\RenderWindow.hpp   93

Would that explain it? I need some help with this because it's getting on my nerves and I can't find help anywhere.

Pages: [1]