Lactose

GDNet+ Standard
  • Content count

    861
  • Joined

  • Last visited

Community Reputation

11387 Excellent

About Lactose

  • Rank
    Advanced Member
  1. What?
  2. You should try it yourself. This forum is not your compiler. If it works - great! Move on to the next step you want to solve. If it doesn't work - try looking at the code and understanding why it does what it does, and what needs to be different in order for it to work as you want it to. If you are still stuck after spending time on trying to solve the problem yourself, post with the current code + description of expected behavior + description of current/actual behavior. Note that this methodology applies to more than just this specific issue.
  3. What I posted was a suggestion that he should consider doing things differently. I think my reasons for suggesting it was made clear in my previous post (which was a "huge wall of text" in order to clarify the much shorter post which just got a dismissive and condescending reply). I did not forbid him from creating 6+ threads per day, nor did I tell him to swap to only using the chat instead of creating threads. I said that he might want to reconsider his approach (with, I think, good reasons why), and I mentioned the chat existing because it can be helpful in ways the forum is not, due to its more direct nature.
  4. That doesn't answer any of my questions.
  5. Do you know how "auto" works? Where is the "auto timeStampPrevious=chrono::time_point<chrono_high_resolution_clock>;" line located? Where did Josh tell you timeStampPrevious variable should be?
  6. Josh's reply covers that part.
  7. Which part(s) of what you said are you having problems with? 1) Drawing the sprite. 2) Waiting for a period of time. 3) Drawing another sprite on top of it? This was explained to you in a previous thread you made. Was the explanation not clear? If so, what was unclear about it?
  8. Using the navigation bar at the top: Activity --> Search. It is supposed to be upgraded/improved somewhat later on -- there's a comment from khawk about it here: Edit: Woops, didn't notice there was another page of replies.
  9. Is it possible to create a stream which contains all forum threads in a given sub-set of forums? E.g. create a stream that contains all threads/posts that appear in only the AI + Math & Physics forums.
  10. struct test { int a; int b; }; Quoted test.
  11. Your constructor is wrong, and you are using uninitialized data. When you draw, you're copying the uninitialized values from the member into the rect, and then you attempt to draw. x = x will assign the value of argument x to itself -- it will do nothing. To refer to the member's x value, you need to write "this->x". This is because when you just write "x", there's no way for the compiler to guess which "x" you want to refer to. Because of this, it will always pick the values passed into the function. Thus, you need to write "this->x = x;" -- and similar for the other lines. In case you're wondering, all class and struct instances have a "this" pointer, which is what we're using to solve this problem. Another solution would be to rename the argument values to something else. Either will work, but it's important to understand why the current code is broken.
  12. Sounds like uninitialized values somehow. Show how you create the GameObjects after "start" and add them to the vector. This probably also means showing the constructors you use for the relevant classes. You said you checked the values of the SDL_Rects and got those bogus values --when? Inside the Animation object, or somewhere else?
  13. My first thoughts were opposite to Alberth's idea. Note that this is all untested. Fill a grid cells that are all the same size (smallest size wanted). In your example image, it looks like there could be 8x8. Randomly select a cell, and merge it with an adjacent cell if the dimensions match. Alternatively, mark all cells as unused. Then select x of them and give their own identifier. Grow them to merge with adjacent cells if they are unused. At the end loop over and deal with e.g. non-rectangles and any potential other cases.
  14. I agree with everything Avalander said. Additionally, I would also stress that if you are working in a team and you are doing something which might affect the workflow of others, communication is vital. Whether it's a quick check to make sure you're not both trying to fix the same bug without knowing that the other person is doing the same, or for planning out more large-scale tasks. It's also important that, when (not if) things don't go exactly as planned, you are able to communicate with others and quickly find the best way forward.