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 - K.F

Pages: 1 2 3 [4]
46
General discussions / Re: SFML 3D logo
« on: August 22, 2015, 12:35:41 am »
Why not? Here it is  ;D



It is 3d, but I mimicked the official 2d one untill it looks 2d now, I completly forgot it was supposed to look 3d  :P

47
General discussions / Re: SFML 3D logo
« on: August 21, 2015, 10:42:22 pm »
Do you need a 3d logo, or is this just for fun? I could help if it was the former.

48
General discussions / Re: SFML 2.3.1 released!
« on: July 11, 2015, 11:31:38 am »
Happy to see Android getting more SFML love  :)

49
SFML projects / Re: Zloxx II - An action Jump'n'Run
« on: September 11, 2013, 05:46:12 pm »
Nice game, played few levels and got all coins without really trying  ;D except a crazily placed one in the labyrinth of 1-3 and the two missables in the beginning  >:(

50
General discussions / Re: A new logo for SFML
« on: March 13, 2013, 03:22:29 pm »
Ugh... I hate dropbox some times it works some times not.

Reuploaded and checked them in a different browser and they work.

51
General discussions / Re: A new logo for SFML
« on: March 13, 2013, 03:02:05 pm »
had 10 spare minutes, so made this  :P



without bg:



It is just a concept but if it is liked I will work on it.

52
I knew vectors could be used in this way for variables but the fact they could hold sprites as well is new to me. :P

Will try this soon, thank you very much.

53
Hi.

 Is there a way to let the user make any number of shapes or sprites without me initializing them first?

 For example, I am making 2D billiard game as exercise using SFML 2.0 and want the player to create the balls by clicking on the place where he wants the ball to be, I want a way for a ball sprite to be created and named "ball_01,ball_02" every time he clicks without me making them one by one.

 Other related question is how do I enter these sprites in a loop or if statement?

 For example, I want a loop or function for these sprites to check for collision with every other sprite without writing different if statements for each sprite?

54
General / Re: Strange behavior
« on: June 21, 2012, 04:58:12 pm »
Yes, I believe that is correct. I changed the time from getting the time from the clock to a number increasing with each loop and that solved the problem. Thanks a lot :  )

Quote
Stop using SFML 1.6 and start sing SFML 2.0rc!

Will do. Hope the clock stops also with window movement in 2.0.

55
General / Strange behavior
« on: June 21, 2012, 04:16:33 pm »
Strange behavior

I'm starting a simple projectile calculator and made this test for vertical falling object, I used one of the tutorials as starting point. The object will bounce on impact with the ground and there is a damping so it won't keep bouncing, but the problem is that if you shake the window of the program with your mouse, the object will bounce higher even though the code has nothing to do with that.

Try it, compile this code and run it then shake the window or even just move it and the box will fly out of it. Can anyone tell me what is happening here?



#include <SFML/Graphics.hpp>
#include <iostream>
using namespace std;



int main()
{


    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Projectile_Test");

    sf::Clock Clock;

    sf::Shape Polygon;
           Polygon.AddPoint(200, 200,  sf::Color(255, 0, 0),     sf::Color(0, 128, 128));
           Polygon.AddPoint(300, 200,   sf::Color(255, 85, 85),   sf::Color(0, 128, 128));
           Polygon.AddPoint(300, 300,  sf::Color(255, 170, 170), sf::Color(0, 128, 128));
           Polygon.AddPoint(200, 300,  sf::Color(255, 170, 170), sf::Color(0, 128, 128));

           Polygon.SetCenter(250,250);
           Polygon.Move(250,250);

    while (App.IsOpened())
    {

        sf::Event Event;
        while (App.GetEvent(Event))
        {

            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        float t = Clock.GetElapsedTime();

        float ElapsedTime = App.GetFrameTime();


        // Move the sprite
        if (App.GetInput().IsKeyDown(sf::Key::Left))  Polygon.Move(-1 , 0);
        if (App.GetInput().IsKeyDown(sf::Key::Right)) Polygon.Move( 300 * ElapsedTime, 0);
        if (App.GetInput().IsKeyDown(sf::Key::Up))    Polygon.Move(0, -300 * ElapsedTime);
        if (App.GetInput().IsKeyDown(sf::Key::Down))  Polygon.Move(0,  300 * ElapsedTime);

        // Rotate the sprite
        if (App.GetInput().IsKeyDown(sf::Key::Add))      Polygon.Rotate(- 100 * ElapsedTime);
        if (App.GetInput().IsKeyDown(sf::Key::Subtract)) Polygon.Rotate(+ 100 * ElapsedTime);


        // Gravitational acceleration value

        float acc=0.5*t;

        // Gravity
        Polygon.Move(0,  acc);



        cout<<t<<'\n';
        float y2 = Polygon.GetPosition().y;

        if (y2 > 550)
        {


                float s= acc ;
                Clock.Reset();

                t = Clock.GetElapsedTime();
                float acc=0.5*t;





                float m =5;

                while(m>0)

                {
                        t = Clock.GetElapsedTime();
                        acc=0.5*t;
                        Polygon.Move(0,  acc);
                        Polygon.Move(0,  -s/1.1);


                        //Polygon.Move(0,  -s/1000);
                        cout<<"loop"<<'\n';
                        cout << "distance="<< y2 <<'\n';
                        cout << "time="<< acc <<'\n';
                        cout << "s="<< s <<'\n';
                        m = s- acc;
                        App.Clear();

                        App.Draw(sf::Shape::Rectangle(200, 350, 600, 400, sf::Color::Green));


                // Display window contents on screen

                        App.Draw(Polygon);

                        App.Display();

                }

                Clock.Reset();
        }



        cout << y2 <<'\n';


        // Clear screen
        App.Clear();

        App.Draw(sf::Shape::Rectangle(200, 350, 600, 400, sf::Color::Green));


        // Display window contents on screen

        App.Draw(Polygon);

        App.Display();




    }

    return EXIT_SUCCESS;
}
 

Pages: 1 2 3 [4]
anything