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.


Topics - _darkus

Pages: [1]
1
General / Help with creating rhythm game
« on: August 27, 2013, 11:15:56 am »
Hello!
I have some questions about rhythm games. Example of good rhythm game is Osu!(u can google it).
So, what is the best way to synchronize music playing and gameplay?
How to implement simple metronome in SFML that will beat with specified BPM?
Any tutorials/articles about Audiosurf-like game development?
I will be glad to hear any advices and recommendations.
Thanks!

2
Window / Same effect as KeyPressed with Gamepad
« on: August 17, 2013, 06:57:41 pm »
Hi there.
if(event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Left)
{
}
 
I use it for navigation in menu, its very easy to handle single key pressures.
But how can i imlement same single pressuers with gamepad?
I can check  "event.type == sf::Event::JoystickMoved" but even with small moving of stick there will be many pressures.
Thanks.

3
Window / Help with implementing framelimit/correct timestep
« on: August 05, 2013, 08:41:40 pm »
Hello everybody.
I need some help with timestep. I tried a lot of methods to implement correct time step, but i none of them helped.
If i use setFrameLimit(60) my game will stutter hard.
If i use VSync - then game use 90% of CPU, but there is no stuttering.
Also, i tried to use this code: (it is from SFML's wiki)
 
        sf::Clock frameClock;
        sf::Clock updateClock;
        sf::Int32 nextUpdate = updateClock.getElapsedTime().asMilliseconds();
        float updateRate(1.0f / 20.f);
        float maxUpdates = 1;
        window.setFramerateLimit(60);

        while (window.isOpen())
        {
                sf::Int32 updateTime = updateClock.getElapsedTime().asMilliseconds();
                Uint32 updates = 0;

                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close();

                        SceneManager::instance().input(event);
                }      

                while((updateTime - nextUpdate) >= updateRate && updates++ < maxUpdates)
                {
                        SceneManager::instance().updateFixed(sf::seconds(updateRate)); 
                        nextUpdate += updateRate;
                }

                SceneManager::instance().update(frameClock.restart());

                window.clear();
                SceneManager::instance().draw(window);
                window.display();
        }
 
Looks better than just setFrameLimit() but there is still some stuttering, even when i use * dt.asSeconds() when moving.
Need some help with it, i will be glad to see your implementation of timestep.
Thanks/

Pages: [1]