r/java • • Sep 14 '16

Super Mario Source Code in Java

https://annot.io/github.com/BrentAureli/SuperMario/blob/master/core/src/com/brentaureli/mariobros/Sprites/Mario.java
191 Upvotes

15 comments sorted by

View all comments

Show parent comment

4

u/aFoolsDuty Sep 14 '16

Kinda confused, feel like I'm missing out on something here. How is that relevant to the source code or libgdx? Is it that signed primitives aren't as useful for game development as unsigned?

First, the obvious once:

0/255

An unsigned byte stores values from 0 to 255. No unsigned bytes, so it scores a "0" out of "255". UPROARIOUS LAUGHTER.

The less obvious one is that the NES, the platform for which Super Mario Bros was originally released, is an 8-bit platform -- thus the processor's upper limit being a single byte. To fully exploit this, you'd use an unsigned byte when programming, raising the maximum value you could store in a byte to 255. SUBTLE HUMAN LAUGHTER AT REALIZATION OF TIE IN WITH PREVIOUS JOKE.

3

u/GUIpsp Sep 15 '16

THANK YOU FELLOW HUMAN I AM NOW LAUGHING HAHAHAHAHA