Main Menu
Menu

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.

Show posts Menu

Topics - Flaze07

#1
General Discussion / 2 tgui::Gui
11 July 2017, 18:33:05
hi...is it allowed to have more than one tgui::Gui

if it is allowed...I wonder why menu.draw makes my program crash

here's part of the code

while (app_win.isOpen())
    {
        sf::Event event;

        if (condition == Condition::start)
        {
            while (app_win.pollEvent(event))
            {
                if (event.type == sf::Event::Closed) app_win.close();
                menu.handleEvent(event);
            }

            app_win.clear();
            menu.draw();
            app_win.display();
        }
        else if (condition == Condition::single)
        {
            sf::Time elapsed = clock.restart();
            snake1.update(elapsed);
            snake1.action();
            snake1.check_apple(apple);
            if (snake1.collision(app_win))
            {
                condition = Condition::over;
            }

            app_win.clear();
            app_win.draw(apple.getShape());
            for (auto& a : snake1.getSnake())
            {
                app_win.draw(a);
            }
            app_win.display();
        }
        else if (condition == Condition::multi)
        {
            sf::Time elapsed = clock.restart();
            snake1.update(elapsed);
            snake1.action();
            snake1.check_apple(apple);
            if (snake1.check_snake(snake2))
            {
                condition = Condition::over;
            }
            if (snake1.collision(app_win))
            {
                condition = Condition::over;
            }
            snake2.update(elapsed);
            snake2.action();
            snake2.check_apple(apple);
            if (snake2.check_snake(snake1))
            {
                condition = Condition::over;
            }
            if (snake2.collision(app_win))
            {
                condition = Condition::over;
            }
            app_win.clear();
            app_win.draw(apple.getShape());
            for (auto& a : snake1.getSnake())
            {
                app_win.draw(a);
            }
            for (auto& a : snake2.getSnake())
            {
                app_win.draw(a);
            }
            app_win.display();
        }
        else if (condition == Condition::over)
        {
            while (app_win.pollEvent(event))
            {
                if (event.type == sf::Event::Closed) app_win.close();
                over.handleEvent(event);
            }

            if (oldcon == Condition::multi);
            app_win.clear();
            over.draw();
            app_win.display();
        }


full code is here https://gist.github.com/Flaze07/f008e65c0c85bcf44f0c46037447f7b5
#2
General Discussion / .dll
10 July 2017, 12:24:47
hi so...I just want to ask something ::)
why is the .dll in lib folder ??



and here's a question that's unrelated to tgui
why is it that
lazarus's forum, codeblock forum, sfml forum, this forum are all....similiar