Move Y value calculation

I was trying to figure out where the Snap Settings Move Y value of 0.32 came from. I don’t think this was ever said in the lecture?

Looks like it’s based on the Pixels-Per-Unit of the block sprite. Pixels-Per-Unit is 128. The block sprite is 41 tall. 41 pixels / 128 PPU = 0.3203125 units, which was apparently rounded to 0.32.

The Snap Settings actually let me put all those decimal places (0.3203125) into the Move Y field, but I’m not so sure they’re actually being used. The inspector only shows two decimal places for Y transform values, though it’s a float and 0.3203125 is a valid float number.

As an aside, I thought this might reveal something about why 128x41 was chosen over 128x40, but I don’t think so. 40/128 = 0.3125, and I don’t think there’s anything particularly special about that. The mystery continues!

1 Like

Hi @couplewavylines,

There’s some info on the reasons for the 128ppu here :slight_smile:
[SOLVED] Snapping to Grid Problem

Nutshell - in one of the lectures Ben mentions about aiming for an iPad Air, and mentions its screen resolution, followed up by the research into how many blocks the original Arkanoid type game had across the screen. The question does come up quite frequently, so you are not alone. If you search for “128” in the search you’ll probably get a few more results too :slight_smile:

Hope this is of help.

Privacy & Terms