Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Digits Formula Help

I made a formula to show a 3 digits number in 3 diferent variables in this HUD:
http://img444.imageshack.us/img444/28/hudzn9.png[/IMG]

http://img444.imageshack.us/img444/1479/numbersformulask2.png[/IMG]
The base number is Points. To show it in-game i separated it in 3 digits: hundreds Xoo, tens oXo, and units ooX.

The problem is when the initial variable (Points) is greater than 100 it doesnt show the digits properly...
 
It seems you've overcomplicated it in places. I don't think you need a separate case for 0 values. Maybe something more like this:

Temp = Points
Xoo = Temp
Xoo /= 100
Temp %= 100
oXo = Temp
oXo /= 10
Temp %= 10
ooX = Temp
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top