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

Pages: [1]
1
General / Re: Using own fixed timestep or setFramerateLimit?
« on: June 08, 2014, 10:34:08 am »
Ok i get it, those are two different things.
Thanks for the fast replies.

2
General / Using own fixed timestep or setFramerateLimit?
« on: June 07, 2014, 06:59:21 pm »
I want to use a fixed timestep in my game and i read a few articles about it but i don't really understand it. Is the setFramerateLimit as good as your own fixed timestep and if not can someone help me with the fixed timestep?

3
General / Re: Problem in release mode
« on: May 27, 2014, 05:33:34 pm »
And the problem disappeared...
Anyways, thanks for your help
And when moving i do: speed * time.asSeconds () so shouldn't the movement in release mode be as fast as in debug mode?

4
General / Re: Problem in release mode
« on: May 25, 2014, 09:20:29 pm »
Now i found this: my bullet moves way faster in release mode then in debug mode, so that it directly leaves the window and gets deleted out of the list. How is this possible???

5
General / Re: Problem in release mode
« on: May 25, 2014, 08:52:29 pm »
Ok i tried that but still not working, when i output the bullets position to the console, it seems that it only updates once in release mode while it stays updating in debug mode

6
General / Re: Problem in release mode
« on: May 25, 2014, 08:18:10 pm »
Ok thanks, but in my bullet class i multiply the speed with the elapsed time from the last frame in seconds, will try outputting position

7
General / Re: Problem in release mode
« on: May 25, 2014, 08:06:33 pm »
Ok, checked my debug/release confguration, read the post, tried some things but it's still not working
Here is some info :
OS: Windows 8.1
Graphics card: NVIDIA GeForce GTX 670
SFML version: latest snapshot(i have compiled it)
Compiler: GCC(MinGW) 4.8.1

Note: the application doesn't crash, i just cannot shoot bullets in release mode, while i can in debug mode

The basic bullet code
#include <SFML/Graphics.hpp>
#include <list>

std::list<Bullet> bullets;
sf::Sprite sprite; //player-sprite

sf::RenderWindow window(sf::VideoMode(1200, 800), "Test", sf::Style::Titlebar | sf::Style::Close);

int main()
{


    while (window.isOpen())
    {

        sf::Event event;
        while (window.pollEvent(event))
        {


            switch (event.type)
            {

                case sf::Event::Closed:
                    window.close();
                    break;
                case sf::Event::MouseButtonReleased:
                    fire();
                    break;
            }


        }

        draw();
    }

}

void fire()
{

    sf::Vector2i mouse_pos = sf::Mouse::getPosition(window);
    sf::Vector2f curPos = sprite.getPosition();
    float angle = atan2(mouse_pos.y - curPos.y, mouse_pos.x - curPos.x) * (180 / PI);
    Bullet bullet(curPos, angle, 800.0f, 300.0f); //start-position, angle, start-speed, acceleration
    bullet.sprite.setFillColor(sf::Color::Red);

    bullets.push_back(bullet);

}

void draw()
{


    for (Bullet bullet : bullets)
    {

        bullet.Update(time);
        window->draw(bullet.sprite);


    }


}
 

8
General / Problem in release mode
« on: May 25, 2014, 03:08:11 pm »
Hello everyone,

I am having a weird problem: i made a game where you play as a moving turret and you need to shoot randomly spawning enemies and everything works in debug mode but in release mode, there is one problem, i cannot shoot. It should shoot when there is a Mouse::Released event.
Can someone help me with this?

Using MinGW and netbeans

sorry for my bad english

Pages: [1]
anything