Ilmari Karonen
Reputation
6,619
Top tag
Next privilege 10,000 Rep.
Access moderator tools
 Nov 8 comment Want to play 1 of 3 tracks depending on current level +1, this should be the accepted answer. You might want to consider using `tracklist[(waveId - 1) % 5]` and moving the `3` to the end of the list, just for the sake of clarity, though. Oct 30 comment How can I calculate current level from total XP, when each level requires proportionally more XP? (Of course, if you're using something like Skyrim-style leveling, where character level is a consequence rather than the cause of skill increases, then things get more complicated, but then you really should be measuring progress based on the skill levels, anyway. And in any case, that's really beyond the scope of this question.) Oct 30 comment How can I calculate current level from total XP, when each level requires proportionally more XP? @Random832: Assuming a classical level-based system, where player abilities (and thus their exp gain rate) only increase significantly when they level up, the "halfway" point (in terms of time to reach the next level) is simply the point at which they've gained half of the exp needed for the next level. You don't need a closed formula for that. Oct 29 awarded Nice Answer Oct 29 comment How can I calculate current level from total XP, when each level requires proportionally more XP? +1; with no offense to @Majte intended, I personally find your explanation more readable. Oct 28 comment How can I calculate current level from total XP, when each level requires proportionally more XP? @Majte: Perhaps I wasn't clear enough. I'm not suggesting that any of the posted solutions would require "millions of iterations". What I meant to say is that, unless you somehow need to calculate the player's level millions of times per second, my (naïve brute-force) solution is more than fast enough. The other solutions, based on algebraically deriving a closed-form formula for the level as a function of exp, may be even faster -- but for code that's only rarely called (and anything less than, say, 1,000 times a second surely counts as "rare" here), it'll make no noticeable difference. Oct 28 answered How can I calculate current level from total XP, when each level requires proportionally more XP? Aug 30 revised Creating a 3D text mesh from a 2D glyph reupload image from imageshack to stack.imgur before it gets replaced by ads; see http://meta.stackexchange.com/q/263771 Aug 29 revised Drawing 2D Images “3D-Like” reupload image from imageshack to stack.imgur before it gets replaced by ads; see http://meta.stackexchange.com/q/263771 Aug 29 revised Get intersected volume of two planes in 3D reupload image from imageshack to stack.imgur before it gets replaced by ads; see http://meta.stackexchange.com/q/263771 Aug 29 revised Generating mipmaps for volume texture reupload image from imageshack to stack.imgur before it gets replaced by ads; see http://meta.stackexchange.com/q/263771 Aug 29 revised Scaling 3D furniture while keeping the thickness constant reupload image from imageshack to stack.imgur before it gets replaced by ads; see http://meta.stackexchange.com/q/263771; better title; misc. copyedits Aug 29 revised Changing orientation by applying torques replace broken ImageShack image with a plot from Wolfram Alpha Aug 29 revised Arrays for a heightmap tile-based map replace broken ImageShack image with a redrawn illustration; misc. copyedits Aug 29 comment Why do meshes show up as bones in the Model class? Alas, without the missing images, it's pretty much impossible to tell what this question is asking about. Aug 29 revised How to handle game states for a single-player / multiplayer game? remove broken ImageShack image (and orphaned supporting text), reword title to avoid "1/2-player" Aug 29 revised Circular Bullet Spread not Even remove broken ImageShack image 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).