• Content count

  • Joined

  • Last visited

Community Reputation

495 Neutral

1 Follower

About povilaslt2

  • Rank

Personal Information

  • Interests


  • Github
  1. Looking for project

    Have some SDL experience, created few programs using WinSock2 on windows.
  2. Looking for project

    Hello. I'm Programmer who is in search of 2D game project who preferably uses OpenGL and C++. You can see my projects in GitHub. Project genre doesn't matter (except MMO's :D).
  3. Question about Observer pattern

    I mean I don't want to put this code in render function. I want to do like callback or etc. Now I added std::function(lamda) as OnDeath function to every enemy and call it at destructor. Function is checking if enemy list has 1 item in it and then call what I need. Just IDK if it's correct usage.
  4. Hello, I have a question about Observer pattern. I have Application class that has lists of objects, enemies and etc and I want to notify Observer when enemies list JUST got empty. How do I do that? Do I extend std::vector's erase function? Application has render method that draws and updates application. Also this method deletes items from vectors if they are dead or etc.
  5. Dunno. Application have everything, enemies, player, UI, Font. So it would be way easier to add delete/objects, apply different font, change texture. Because otherwise i need to add a lot of arguments to a lot of functions to do the same.
  6. I mean instead of referencing TextureManager object in game object constructor I would reference Application object which is shown in first post for more flexibility.
  7. One more question. Can I just add whole Application object reference when creating an object? Because I will need it to create object on collision for example and even more.
  8. Hello, i'm currently developing spaceshooter game and I encountered few problems with game code design. I have Application class where all managers are. class Application { public: ~Application(); Application(); void addShader(const std::string&, std::shared_ptr<Shader>); void loadTexture(const std::string&, const std::string&, int, int, glm::vec2); std::shared_ptr<Texture> getTexture(const std::string&); inline std::shared_ptr<Font> getFont(const std::string& name) { return fontManager->getFont(name); } void loadFont(const std::string&, const std::string&); inline GameState getState() const { return gameState; } inline void setState(GameState state) { gameState = state; } inline std::shared_ptr<InputManager> getInputManager() const { return inputManager; } inline std::shared_ptr<Renderer> getRender() const { return renderer; } private: std::shared_ptr<Renderer> renderer; std::shared_ptr<TextureManager> textureManager; std::shared_ptr<InputManager> inputManager; GameState gameState; std::shared_ptr<FontManager> fontManager; }; But problem is that I need to access in example TextureManager class somewhere in "OnCollision" method to change texture of collider. How do I do that? Do I create TextureManager singleton or what?
  9. Ye but what if all enemies and player have use Base class which has bullets vector? Then I need to check player to enemies and enemies to player because of bullets?
  10. Hello. I'm trying to make dynamic collision detection system. In example: automatically adjust collision detection when new vector of objects added and etc. Now I have few vectors and I'm trying to do collision by just passing vector/object as parameter in "CheckCollision" function. player->Update(application, dt); if (player->CheckCollision(&enemies)) { InitScene(); application->SetState(GameState::NOTSTARTEDYET); UI["Pause Menu"]->HideAllElements(); UI["Options"]->HideAllElements(); UI["Main Menu"]->ShowAllElements(); } for (auto enemy : enemies) { enemy->Update(dt, t); if (enemy->CheckCollision(player)) { InitScene(); application->SetState(GameState::NOTSTARTEDYET); UI["Pause Menu"]->HideAllElements(); UI["Options"]->HideAllElements(); UI["Main Menu"]->ShowAllElements(); } } Can I somehow change this code to make code more dynamic when I add more vectors with enemies.
  11. MY Space Shooter code review

    BulletManager is used to create/update/render bullets. Bullets can be added from player or other class. So I have to create new instance in every class that uses? or just pass reference when updating? FontLoader is used to load/use fonts in a lot of classes. Should I make just make reference of it in main.cpp? Renderer is used to render objects. Should I also make instance of it in main.cpp? What should you offer? To add constants to Player and etc classes?
  12. MY Space Shooter code review

    Hello, I'm developing space shooter game and need yours advice on code. What is good/bad and etc. All elements, enemies, UI are placeholders at this moment. https://github.com/Povilas-Jablonskis/Space-Shooter
  13. Help to review my first harder game

    Thank you so much for your feedback. I read all and will apply in my code!
  14. Help to review my first harder game

    Thanks for advice. I did that because when I minimise window and such then back to the game my always character falls off screen because delta time was + 1 :X. What do you advice to do with deltatime?
  15. Hello, so today I just finished my first harder game and I want to experienced programmers try to review my code and say what's wrong and try to advice me what to do better.   Here's the source and game. https://github.com/Povilas-Jablonskis/SideScroller/   Controls: w for jump, climb up. s for crouch, climb down. a for walk left, climb. d for walk right, climb. mouse1 to jump( mouse must be higher than player's sprite ) ESACAPE to PAUSE   Objective is to reach the end sign.   Thanks for advance.