No announcement yet.

Target Practice score

  • Filter
  • Time
  • Show
Clear All
new posts

  • Target Practice score

    Curious thought and question.

    Since Pocket Tanks was developed on the 32-bit platform, there's a 32-bit integer limit, and I've been wondering, what would happen if your score were to reach the 32-bit integer limit? Would the game crash, would the numbers roll over, or would the game simply start glitching out on you?

  • #2
    From Ben, our code wizard at large:

    "Pocket Tanks stores the score as a signed (positive or negative) integer. Technically, integer overflow for signed integers is what's called "undefined behavior," meaning that the computer can do anything (wrap the number around, crash, explode) or nothing. In practice, the score will just wrap around to a negative number. Pocket Tanks does check for negative scores and resets those to zero."
    Quid custodit ipsos custodes

    My Administrative motto

    Wielder of a +1 Vorpal Sword of Banning.