Jump to content

Guide to Game Development/Miscellaneous/Implementing an XP system

25% developed
From Wikibooks, open books for an open world

Programming XP - Avoiding overflows

[edit | edit source]

In a traditional game, the higher your level is, the more XP you'll need to get another level up. The problem with a basic approach to this is that you could very quickly run into stack overflow problems.

Example of bad code with overflows

[edit | edit source]

Example of fixed code without overflow problems

[edit | edit source]


Clipboard

To do:
Look into: http://www.reddit.com/r/programminghorror/comments/234mw6/a_simple_leveling_system/


References

[edit | edit source]