• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

povilaslt2

Members
  • Content count

    46
  • Joined

  • Last visited

Community Reputation

495 Neutral

About povilaslt2

  • Rank
    Member

Personal Information

  • Location
    Lithuania
  1. 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.
  2. 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.
  3. 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.
  4. 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?
  5. 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?
  6. 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.
  7. 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?
  8. 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
  9. Thank you so much for your feedback. I read all and will apply in my code!
  10. 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?
  11. 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.
  12. 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.
  13. Modelview matrix: glGetFloatv(GL_MODELVIEW_MATRIX, modelView); Yep, I see right color that was set with glClearColor. I don't see anything but blue screen. When I change glClearColor nothing changes but background color. I use glClearColor on main.cpp, main function just before glutMainLoop.
  14. The reason for checking the values is just to make sure you are getting what is expected. I'm sticking with the matrix data is wrong for whatever reason. I also agree with Irlan, you could be ordering your calls incorrectly or leaving something out. I see that, assuming this is full code for that method, you are missing a call to glLoadIdentity for your model matrix. static void resize(int width, int height) { //const float ar = (float) width / (float) height; glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0, width, 0.0, height, -1, 1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); //Was missing in above code } If worst comes to worst, which this might actually be better in the long run. You could just ditch the glOthro, glMatrixMode, and etc calls and just compute the ortho matrix yourself using a custom function. Storing the results in a float array, from there its just passing that along to the shader using the uniform calls you have       OpenGL it's a state machine basically. You need to check if  you're binding something where shouldn't be bound.   Try to change the orthographic matrix to the following: glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0f, width, height, 0.0f, 0.0f, 1.0f); glMatrixMode(GL_MODELVIEW); (...) and see if you get different results. Check if you're correctly computing your Model-View matrix.   Thank you both for answers but it didn't help. float triangle[18] = { // Left bottom triangle -1.0, 1.0, 0.0, -1.0, -1.0, 0.0, 1.0, -1.0, 0.0, // Right top triangle 1.0, -1.0, 0.0, 1.0, 1.0, 0.0, -1.0, 1.0, 0.0 }; float texture[12] = { // Right top triangle 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, // Left bottom triangle, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0 }; glGenVertexArrays(1, &uiVAO); glBindVertexArray(uiVAO); glGenBuffers(1, &uiVBO); glBindBuffer(GL_ARRAY_BUFFER, uiVBO); glBufferData(GL_ARRAY_BUFFER, 18*sizeof(float), triangle, GL_STATIC_DRAW); glVertexAttribPointer( 0, // The attribute we want to configure 3, // size GL_FLOAT, // type GL_FALSE, // normalized? 0, // stride 0 // array buffer offset ); glGenBuffers(1, &uiVBO2); glBindBuffer(GL_ARRAY_BUFFER, uiVBO2); glBufferData(GL_ARRAY_BUFFER, 12*sizeof(float), texture, GL_STATIC_DRAW); glVertexAttribPointer( 1, // The attribute we want to configure 2, // size GL_FLOAT, // type GL_FALSE, // normalized? 0, // stride 0 // array buffer offset ); glBindVertexArray(0); glBindBuffer(GL_ARRAY_BUFFER, 0); Maybe it will helps somehow..