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

Pages: 1 [2] 3 4 5
16
General / Re: Weird movement in my program[SOLVED]
« on: August 17, 2015, 04:25:27 pm »
I will come back to it after I learn the general grasp of using the SFML library. I do want to create some physics.

17
General / Re: SFML 2.3.1 GAME DESIGN LESSONS
« on: August 17, 2015, 04:12:29 pm »
I think another Tutorial Series is a great idea. The more lessons there are about SFML the more people will want to use it. SFML is a great Library to learn I encourage more people to use it and I encourage more people to teach it. CODEINGMADEEASY might not have had the best tutorials but he did help solve a lot of problems and he did inspire a lot of people to become better programmers. 

18
General / Re: Weird movement in my program
« on: August 12, 2015, 01:56:29 pm »
I figured it out.. I was showing my FPS in command prompt but I was clearing it using system("CLS") and that created the wobble to the Game loop.

Thanks Everyone!

19
General / Re: Weird movement in my program
« on: August 12, 2015, 01:41:26 am »
ohh naw, He suggested a good idea so I had a question about it. I do own a few C++ books and all the SFML books.. thats how I've learned C++ over the past year. Do you have any idea why the game loop has like a gallop to it?

20
General / Re: Weird movement in my program
« on: August 12, 2015, 12:26:38 am »
I can see how this could become a mess.. could I create a like a Init_Game() function and put that into the game constructor?

21
General / Re: Weird movement in my program
« on: August 11, 2015, 11:14:48 pm »
Okay so Thanks to Arcade I got this sticky movement fixed. I initialize some variables and 'D' key fixed..
Arcade how would you initialize everything in an initialization list in your constructor ?

Jesper, That really help explain a lot thankyou. The FPS seems to be working correctly however it seems to gallop.. I added a sf::shape called test that just moves across the screen and he seems to gallop.. I don't know how to explain it. same with player movement.

Game.cpp
(click to show/hide)

Game.h
(click to show/hide)

22
General / Re: Weird movement in my program
« on: August 11, 2015, 09:22:07 pm »
Its got to be something simple or something I'm over looking. but what happens is the movement isn't smooth.. and feel sticky.. press 'W' key and release keeps moving up for a few seconds and always moves to the right if you pressed 'D' key once.

With setFramerateLimit() uncommented it does keep a steady FPS.. however its still had that sticky movement. I'm bewildered..


My current code..
Main.cpp
(click to show/hide)
Game.cpp
(click to show/hide)
Game.h
(click to show/hide)

23
General / Re: Weird movement in my program
« on: August 11, 2015, 08:44:50 pm »
setFramerateLimit() was commented out because it would sleep my whole game loop and it was causing problems with eventpoll. That's how we got to creating fixed time step. (from my understanding and research is sleeps from the window.display() but don't take my word for it I've read so many forms about time step)

The reason the events were in the inner loop is because its straight out of the SFML book. What I have its identical to the source code. probably why I'm really confused on why this isn't working right. The book must be wrong.

24
General / Re: Weird movement in my program
« on: August 11, 2015, 07:48:16 pm »
I added in a function that shows my FramesPerSec and I'm getting like 340ish.. and it should be set at 60 :'( something isn't working correctly

25
General / Re: Weird movement in my program
« on: August 11, 2015, 06:18:36 pm »
that just confusing me even more.

This should work, but I'm still running into the same problem..
void Game::run()
{      
        sf::Clock clock;
        sf::Time timeSinceLastUpdate = sf::Time::Zero;

        while (_Window.isOpen())
        {
                sf::Time elapsedTime = clock.restart();
                timeSinceLastUpdate += elapsedTime;
                while (timeSinceLastUpdate > TimesPerFrame)// sf::Time TimesPerFrame = sf::seconds(1.f / 60.f);
                {
                        timeSinceLastUpdate -= TimesPerFrame;

                        //Handle Events
                        processEvents();
                        //Game Logic
                        update();
                }

                //Draw to Screen
                render();
        }
}
 

26
General / Re: Weird movement in my program
« on: August 11, 2015, 05:31:38 pm »
So I read http://gameprogrammingpatterns.com/game-loop.html it was the most helpful to explaining what is going on..

I'm also trying to follow the book and compare something is not right here. same movement issues and the numbers don't seem right.

Game.cpp
(click to show/hide)

27
General / Re: Weird movement in my program
« on: August 11, 2015, 04:29:17 pm »
Thankyou.. I had a feeling something weird was going on I just could not put my finger on it.

28
General / Weird movement in my program[SOLVED]
« on: August 11, 2015, 04:00:32 pm »
I'm getting back into C++ before I forget it all.. I'm vary rusty. I'm following all the SFML books and tutorials.

The question I have is Why is my _Player movement is radical?
Is this because of the _Window.setFramerateLimit(FPS) ?

Main.cpp
(click to show/hide)
Game.cpp
(click to show/hide)
Game.h
(click to show/hide)

29
General / Re: Tutorial switch help?
« on: August 10, 2015, 04:57:41 pm »
Thank you guys! now I need to work in smoother movement.

CODE:
(click to show/hide)

30
General / Re: Tutorial switch help?
« on: August 10, 2015, 02:34:25 pm »
Yeah I get that..  I'm trying to find a solution and I just got a brain block when it comes to this switch statement. I can work it witch a if statement but its ugly

Pages: 1 [2] 3 4 5