Jump to content
  • Advertisement

nobodynews

Member
  • Content Count

    2468
  • Joined

  • Last visited

Everything posted by nobodynews

  1. nobodynews

    Yet another SDL question (or maybe it's not)

    Lactose is correct, but as an addendum you can do something similar to what you did (using the same variable name) if you utilize member initialization lists. So your constructor could be as follows: GameObject::GameObject(int x, int y, int w, int h) : x(x), y(y), w(w), h(h), _destroyed(false) { rect.x = x; rect.y = y; rect.w = w; rect.h = h; } Without getting into the merits of using the same name for the parameters and member variables, this is just to note that it's possible.
  2. nobodynews

    Breaking out of for loop

    void CInputManager::SetRawButtonState(const RAW_BUTTON pButton, const bool pState, const bool pPrevState) {     for(auto &context : mContexts)     {         if(context.IsActive())         {             if(pState && !pPrevState)             {                 if(context.MapButtonToAction(pButton)) break;             }             if(context.MapButtonToState(pButton, pState)) break;         }     } } FWIW I believe this should perform the same and I find it to be simpler to read.   edit: and if you want to compress it further: void CInputManager::SetRawButtonState(const RAW_BUTTON pButton, const bool pState, const bool pPrevState) {     for(auto &context : mContexts)     {         if(context.IsActive())         {             if(pState && !pPrevState && context.MapButtonToAction(pButton)) break;             if(context.MapButtonToState(pButton, pState)) break;         }     } }
  3. nobodynews

    read int from char * question

    I know that Visual C++ compiler extensions (in the past and maybe today) would bind temporary variables when passing by reference to non-const functions. This is different from passing a constant by non-const reference though, but maybe early compilers like Visual C++ 6.0 allowed that too for some reason. It wasn't very standard's compliant, after all. Alternately, Johnny Code is remembering wrong.
  4. This can be done in pretty much literally any programming language that you can think of. BeerNutts' suggestions might be easier to get you where you want, but I haven't used them so I can't comment on that. I really don't think switching to C++ and using 'function pointers' is good advice given you know some C#. Side note: delegates are similar to function pointers, fwiw.
  5. nobodynews

    ifstream & ofstream binary troubles

    There's a lot of stuff that you could improve in your code, the issue you're running into now is that you aren't writing the output as a binary file: fsOut.open("output.txt"); Even though you're using the "write" member function, stream behaves differently since it's not binary. I tested it out and it completed successfully.
  6. nobodynews

    Wanting to create my own Game Engine

    There's definitely truth to what L Spiro says, I just don't take as hard-line a stance on it. GLFW is a crossplatform library to make windows and get inputs. Your interests may lie elsewhere in terms of making an engine. I liken it to cooking. If you want to make an Italian dish you might just not have any interest in making homemade noodles so you buy those. Since you like making sauces you grow your own herbs and tomatoes so you have the freshest ingredients that taste how you want them. Not to say you should avoid making noodles! You might really like it and it might be worth it to bring out the flavor of your homemade sauce. I guess this is to say that not making your own noodles doesn't mean you're not cooking. But it might be better if you did.
  7. 1. Should be fine. Why wouldn't it be? 2. This is used to cap the frameTime to at most 250ms to prevent the game loop from taking longer and longer to run as it tried to catch up since the previous frame. Why 250ms? Probably no specific reason. It 'felt right'. With it, the game will update the simulation in 250ms chunks for every frame regardless of how long it takes in real-time. If it takes 1 second of real time to run 250ms worth of simulation and draw one frame then you'll get 1 frame per second and 250 worth of simulation. The experience would be terrible but if it was temporary the player could get past it. It would be a brief stutter in gameplay. If it was more common then the player would have to get a better computer (or you have to write better code). There's no real reason you couldn't change that time to 0.125 or something else. 3. Depends. If your simulation runs every 1/30 second do you want to handle events that occurred between steps? I think most people would say "yes", but its up to you. 4. You probably won't see a difference with just two sprites and without complicated simulation. The main benefits come when you have complicated simulation logic (i.e. physics that uses integration for example), if you want to easily record and play back the simulation, or with multi-player. Think about how two people playing across the planet have to keep their simulations in sync and how that is difficult if both players are running physics at different and inconsistent rates every frame. If you assume both players are on the same rate you don't have to work as hard to keep them sync'd.
  8. nobodynews

    For what functions we use the word "On"?

    Those On* functions are event handlers that are called by the Unity engine. An event handler is just a specific type of 'callback function'. So, are your functions also event handlers? If not, I would suggest some other naming convention. If you're unsure, please explain how you plan on using those functions.
  9. Your bigger issue isn't patents its copyrights. If you want to re-use any of their work you'll need permission. If you don't have their permission you need to create original art, sound, and code. About the only thing you can typically copy is core gameplay aka make knockoff.
  10. nobodynews

    Beginner with a dream.

      "UI" is a very broad category so it'll help if you expand on the context in which you want to create a UI. Assuming you specifically mean GUIs, there are "WYSIWYG" editors which can help make desktop application style user interfaces. Microsoft's Visual Studio lets you make these for many languages, including C#. This is supported by the Express and Community editions of Visual Studio, both of which are freely downloadable from Microsoft. However, this might not be what you actually want. Unity supports "UI" elements as well for in-game GUIs (for menus and such).   In all cases it still requires some programming knowledge to cause the UI to do something practical rather than just something you look at.
  11. nobodynews

    Collision using rgb

    A very simple thing you can do that should work is return different numbers for the different errors instead of using the same number. Also, you should learn how to use a debugger. Vimeo is blocked at work so I can't check how useful it is, but Google suggested this video.
  12. nobodynews

    Collision using rgb

    What compiler errors are you getting? Also, I'm confused about what the issue is with the file loading. It sounded like a bug, but then you say the code doesn't compile which implies you haven't run the code. If it is a bug, what is the behavior you are seeing?
  13. Another way of looking at it, is imagine yourself as the normal. On Earth as you walk around upright you are essentially the normal at that point on Earth because you are perpendicular to that point of the planet.   But imagine you are an astronaut and you are in zero G environment, say on the outside of some space station. Your boots let you stick to the outside so you can walk around it. If you imagine yourself trying to walk around the space station 'upright' then your orientation will be the same as the normal at that point on the space station. Doesn't matter what shape the space station is, you can be upright at any point on it provided you can stick to it.
  14. Yeah I feel the same way about books, they all just use words to tell a story, they don't do anything original. I'm looking for something new.   Ok, that's unfair, but honestly you're premise is vague. I'd like some examples of games which you consider 'too similar'. I check steam fairly often and I don't remember seeing an 'overload' of RPG Maker titles.
  15. nobodynews

    Advice on coding style

    I hope for your sake you're using one of the updated versions of Dev C++ and not the incredibly out-of-date Bloodshed version.
  16. nobodynews

    User defined functions?

    These are called 'callback functions'. Your library code would use function pointers instead of functions directly. The user would pass the function pointers to your code.
  17. nobodynews

    C# Color Wheel

    Oh well if it doesn't matter what it's used for, how about using the standard color picker dialog defaulted to display the color grid using the custom colors property  (ok, it's not a wheel, but it's close). After the user selects a color then check the hue/saturation/etc. If it's outside the acceptable range re-open the dialog. Maybe pop-up a message dialog saying the value chosen is invalid and to try again. Technically fits most of your requirements.
  18. nobodynews

    Why didn't somebody tell me?

    That's a mondegreen I haven't heard of before.
  19.   I'd have done xnew = (x * cos(theta)) - (y * sin(theta)) ynew = (x * sin(theta)) + (y * cos(theta)) For both of these equations, as the naive coder would accidentally use the same variable names for both the input and output which would produce faulty results.
  20. I get the sense the OP wants to extrude the polyline into a strip or maybe a solid from it.
  21. nobodynews

    [SlimDX] Information on the history of SlimDX

    I admit it was awhile ago and it could be a false memory, but I'm like 50% sure I came up with this slogan on IRC.
  22. nobodynews

    Another basic array C problem

    Getting an "MS account" is free. If you still don't want to get an MS account that's your prerogative, just don't want to scare people off who don't care about getting an account.
  23. nobodynews

    Solve this Logic Question...

    I don't really think the original form is ambiguous in what it means, if you're familiar with the grammatical form used. When you have A and B, with C and D applied respectively, that means C is applied to A and D is applied to B. Word problems are about using both grammatical and mathematical skills, so the word choice may have been intentional. Thus, changing the wording to make it easier to parse would be missing the point. Or maybe it was just badly written.
  24. nobodynews

    X3DB format

    There's a C++ library called XIOT which I've seen a few projects use which can open X3DB files. X3DB files seem to be compressed so there's a decoding stage done first. The XIOT project site seems to be down, but the MEPP project imported XIOT into their project https://github.com/MEPP-team/MEPP/tree/master/externals/xiot-0.9.0.
  25. nobodynews

    What language is this made in?

    I'm at work so a lot of stuff is blocked, but I do know the original demo made for the game jam was Adobe Flash and a bunch of sites say it was ported to a 'new engine', although I can't see details beyond that. I found a journal entry from the developer from Dec 2013 saying "I’ve got a pretty solid version of the game running with adobe AIR, but maybe I should port it over to C++ for a more stable game and things like actual controller support if I continue it further." so probably either AIR or something using C++. As for the 2d perspective used, this link seems to explain what it is as 3/4 perspective. I believe 2.5d is a more generic term for making 2d look kinda like 3d and thus includes several art styles. Another overview of different types of projections (although it doesn't get into 3/4 perspective) is here.   It's definitely not platformer, that's more of a gameplay style than an art style.   According to this Unity can do it.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!