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

Pages: [1]
1
General / SFML Book Scene Graph Matrix
« on: August 17, 2013, 11:11:49 pm »
I reading the sfml game developing book, but I am have problems to understand the scene graph   
in connection with the matirx (Transformation).
The problem is, that I dont know a matrix good.
I know only that a matrix is a table with rows and rives, but not anymore.
Where i can learn to understand the matrix from sfml with rotation and transformation and the other matrix stuff that I dont know ?

Sorry if the question is difficult to understand, but I am german.

2
General discussions / SFML Book chapter 2 question
« on: August 01, 2013, 07:07:10 pm »
I read at this moment the sfml development book.
I am at chapter 2 before the headline Error handling.
There stand at the TextureHolder class, two get methods
first:
sf::Texture& get (Textures::ID id);
 
second:
const sf::Texture& get (Textures::ID id) const;
 

But I dont understand the sense of the second method.
The methods do  actually almost the same.

3
General / Re: Elapsed Time is scary
« on: July 19, 2013, 09:45:39 pm »
Ah ok now I have the mistake.
But sometimes i can see a small irregularity.
How can made it better?

Player class:
        sf::CircleShape player;
        sf::Vector2f pos;

        void handleEvent(sf::Event &renderWindowEvent)
        {
        }
        void update(sf::Time &elapsedTime)
        {
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::D))
                {
                        pos.x += 10000 * elapsedTime.asSeconds();
                }
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::A))
                {
                        pos.x -= 10000 * elapsedTime.asSeconds();
                }
                player.setPosition(pos);
        }
        void render(sf::SpriteBatch &spriteBatch)
        {
                spriteBatch.draw(player);
        }
 
Game Loop
sf::Clock elapsedTime;

        while(renderWindow->isOpen())
        {
                sf::Event renderWindowEvent;
                while(renderWindow->pollEvent(renderWindowEvent))
                {
                        handleEvent(renderWindowEvent);
                }

                update(elapsedTime.restart());

                renderWindow->clear(backgroundColor);
                render(*new sf::SpriteBatch(renderWindow));
                renderWindow->display();
        }
 

4
General / Elapsed Time is scary
« on: July 19, 2013, 08:50:07 pm »
Why my player doesent move smooth?
        while(renderWindow->isOpen())
        {
                sf::Clock elapsedTime;

                sf::Event renderWindowEvent;
                while(renderWindow->pollEvent(renderWindowEvent))
                {
                        handleEvent(renderWindowEvent);
                }

                update(elapsedTime.getElapsedTime());

                renderWindow->clear(backgroundColor);
                render(*new sf::SpriteBatch(renderWindow));
                renderWindow->display();
        }
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::D))
                {
                        pos.x += 1000 * elapsedTime.asSeconds();
                }
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::A))
                {
                        pos.x -= 1000 * elapsedTime.asSeconds();
                }
 

I got the most time, if I print the time out as Seconds 3.25-e-005.
Whats that and how I can fix that?
Normal the player should in that case move 1000 pixels per seconds, but he doesent.
Please help.


5
Graphics / SFML best objekt for drawing
« on: July 19, 2013, 02:12:34 pm »
I want to make draw method, for a GameObject, but I dont want to give a pointer to the RenderWindow, because I can in the RenderWindow set for example the size, too.
have SFML a Class with that, I can draw something, or must I made a class myself?

6
General / Re: Architecture from a basic state manager
« on: July 13, 2013, 05:28:14 pm »
Yes with a stack.
Oh I have forgot the push and opo methods, but thats in this case not Important.
I want to knwo the best way, how I State kann change the State of the Statemanager without an pointer to the Statemnager, because I want to protect the update, draw, handleEvent methods from a State(Why should a State run the update Method!?).

7
General / Architecture from a basic state manager
« on: July 13, 2013, 09:59:04 am »



Hi !
My Questions:
Whats the best way, how I can set the state from the state manager in a state?

Give it a better way as my class Graphics to protect the properties from the render window?

And whats your meaning about this?

8
General / SFML Book Topics
« on: July 12, 2013, 11:57:04 pm »
What are the Topics of the new SFML Book?
Is in the Book only explained how I can  draw something, or I can play sounds usw.., or is there explained how to structure a game, too?
Know someone tutorials about the structure from a game?

Pages: [1]