Ilmari Karonen
Reputation
6,398
Top tag
Next privilege 10,000 Rep.
Access moderator tools
 Aug 29 revised How would you handle different aspect ratios in a 2d platformer? remove broken ImageShack image, tidy up list formatting, misc. copyedits Aug 17 revised How to Effectively Create Bullet Patterns reupload image from imageshack to stack.imgur before it gets replaced by ads; see http://meta.stackexchange.com/q/263771 Aug 17 comment Why do meshes show up as bones in the Model class? ImageShack seems to have deleted your images and replaced them with ad banners. If you can, please reupload the images (or something equivalent) using the image upload button in the editor toolbar (which will upload them to Stack Exchange's imgur account). Aug 17 revised Modifier System C# recover broken imageshack image from source article Aug 17 revised How to implement behavior in a component-based game architecture? reupload image from imageshack to stack.imgur before it gets replaced by ads; see http://meta.stackexchange.com/q/263771 Aug 15 awarded Yearling Aug 9 comment How can I implement gravity? @Fabio: Not really. What we're doing is applying the full force once, then recalculating the force at the new location (and time and velocity), and adjusting the velocity change by half of the difference between the new and the old force. Thus, the total change in velocity is, in effect, the average of the new and the old force (divided by mass). Here's a diagram that might (maybe) make it a bit clearer. Aug 9 comment How can I implement gravity? @Fabio: Oh, I see. Any way you implement impulses, you'll want the total velocity change (in the absence of other forces) to equal the impulse. Using my pseudocode above, one way to achieve that is to add `J/dt` to both `force()` calls. Another way is to handle impulses separately from continuous forces, e.g. by adding an extra line like `velocity += impulse;` (and optionally `position += (time - inpulseTime) * impulse;` where `impulseTime` is the exact time at which the impulse occurred) to my pseudocode. (Before the second call to `force()` is probably best, though I haven't tested this.) Aug 9 comment How can I implement gravity? @Fabio: Honestly, I'm not entirely sure what you're asking. In my pseudocode, the first parameter to `force()` isn't the timestep, but the current time (and you're free to leave it out of your own code, if your forces are not (directly) time-dependent). Jul 26 revised How do I implement a retro-style password-based “savegame” system? this question is not specific to any particular language Jun 23 reviewed Approve Creating a separate renderer for entities in a 2D game May 24 comment How to render infinite universe? Do you plan on having some kind of a maximum view distance, or do you have some way of merging distant points so that you don't have to render them individually, or are the "points" opaque and arranged so that most of them will be hidden from any given viewpoint? Because if none of the above hold, I don't see any way to prevent the user from finding camera angles from which most of the points (or at least a significant fraction of them) will be visible at the same time. May 19 comment Trying to implement gun cooldowns in C# @Zee: If the longer cooldown is meant to simulate reloading a clip, then you might not want to auto-reload until the gun is empty, or unless the player explicitly does an early reload. May 19 comment Trying to implement gun cooldowns in C# Why have the `if (bulletCounter == 3)` check outside the keypress handling code? The only way `bulletCounter` can become `3` is by getting incremented when a shot is fired, so it IMO makes more sense to check for it right there. (For example `if (bulletCounter == 3) { gunCooldown = Time.time + 0.80f; bulletCounter = 0; } else { gunCooldown = Time.time + 0.12f; }` or even just `gunCooldown = Time.time + (bulletCounter % 3 == 0 ? 0.80f : 0.12f );`) Apr 23 comment Pausing the game inside the game loop @user3730788: A branch that executes once per game loop (i.e. less than 100 times per second) will have no discernible performance impact, not even if it's mispredicted every time. Apr 12 answered Strategy game tile and unit storage Apr 7 comment Framerate is affecting speed of object @MooingDuck: Well spotted. I've fixed it now, I think. Thanks! Apr 7 revised Framerate is affecting speed of object fix lastTime tracking per comments Apr 7 awarded Nice Answer Apr 7 comment Framerate is affecting speed of object @MooingDuck: That's a very good point. I've edited my own answer to reflect it. (Usually, you shouldn't be dividing anything by the timestep in a typical game state update, so a zero timestep ought to be safe, but allowing it does add an extra source of potential errors for little or no gain, and thus should be avoided.)