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

Pages: [1]
1
SFML projects / Bullet Hell Game
« on: April 09, 2020, 09:25:52 pm »
Recently I've been working on a bullet hell style game with SFML. The game features "waves" where the player dodges the oncoming projectiles from the top of the screen.

Github repo (game can be downloaded here):
https://github.com/NipIsTrue/SFML-Bullet-Hell-Game


Features:
  • Mod System allowing for custom content in lua (documentation still in progress)
  • Procedurally generated waves for unique gameplay (still being improved upon)
  • Admin Console where commands can be entered
  • 12 enemy types with more being made
  • Customizable keybinds

This is my first time making a full game on anywhere near this scale, and I would appreciate any feedback. The game is still in progress, and I am working on documentation for the mod system.

Screenshots are attached to the post.

2
Graphics / OpenGL error INVALID_OPERATION occurring for no reason?
« on: February 07, 2020, 01:49:58 pm »
I am working on a simple 2d game in sfml, and I recently ran into a problem when trying to write a mod system for the game. Basically, the mod system works by loading a dll into memory, and calling functions from it that return a subclass of one defined in my game. The loading works fine and the object is instantiated correctly, but it appears to have broken part of my rendering code that worked before, namely this part:


void Environment::render(sf::RenderWindow& window) {
        for (Spawner* spawner : m_spawners) {
                spawner->render(window);
        }

        for (Enemy* enemy : m_enemies) {
                enemy->render(window);
        }

        m_player.render(window);

        sf::RectangleShape shape(sf::Vector2f(20, 400));
        shape.setFillColor(sf::Color::Black);
        window.draw(shape);

        shape.setPosition(420, 0);
        window.draw(shape);

        shape.setSize(sf::Vector2f(400, 20));
        shape.setPosition(0, 0);
        window.draw(shape);

        shape.setPosition(20, 420);
        window.draw(shape);
}

While the spawners are rendering, the console prints a bunch of opengl errors. After further investigation with the debugger (visual studio). It appears that my spawner->render() function is never being called, which is odd. I'm not entirely sure what is happening here as this code works fine with spawners that are instantiated in the executable and not loaded from the dll. I'm new to loading a dll at runtime, is there some sort of problem I'm missing here?

3
Graphics / Assertion failed after trying to draw text to a window
« on: September 18, 2019, 10:46:59 pm »
So I am trying to draw some simple text to a window, and when debugged, I get an assertion error that looks like this:
Debug Assertion Failed!

Program: C:\WINDOWS\SYSTEM32\MSVCP120D.dll
File: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xtree
Line: 327

Expression: map/set iterators incompatible

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

after
window.draw(text);

Here is the code that causes the assertion:

void Editor::render(sf::RenderWindow& window) {
        sf::RectangleShape shape(sf::Vector2f(500, 500));
        shape.setPosition(50, 50);
        shape.setFillColor(sf::Color(30, 30, 30));
        window.draw(shape);

        sf::Text text;
        text.setFont(font);
        text.setString("Test");
        text.setFillColor(sf::Color::White);
        text.setPosition(100, 100);
        window.draw(text);
}
 

font is a member of the Editor class, and loadFromFile() is called in the constructor, and appears to work fine.

When built and ran in release mode, I get an access violation exception, if that means anything.

4
Window / RenderWindow::pollEvent() appears to not be working
« on: August 19, 2019, 05:54:57 pm »
The window.pollEvent() function in my game loop appears to not be handling any events, and the created window won't respond to anything. Here is the code for my game loop:
void Application::run()
        {
                sf::Context context;
                window.setFramerateLimit(60);

                while (window.isOpen())
                {
                        sf::Event e;
                        std::cout  << "loop" << std::endl;
                        while (window.pollEvent(e))
                        {
                                std::cout << "event" << std::endl;
                                handleEvent(e);
                        }

                        update();

                        render();
                }
        }
 

The print statement never prints "event", but "loop" prints repeatedly, so I know the loop is running. The result is that the window won't respond if I try to resize it or close it, and eventually windows marks it as "not responding". I am using the snapshot from    13-May-2019 19:49 from the download page.

Pages: [1]
anything