Fundamental Units - 2D Physics in PlayBasic

## Fundamental Units of 2D Physics

It's customary and almost a cliche to begin an introductory text on physics with one of two approaches.

1. Attempt to blow your freekin' mind in two paragraphs.

As I believe that you will eventually blow your own mind reading through and attempting some of the examples here, I've opted for the second approach. However, such a discussion should (but never does) start at the real beginning — why are there fundamental units of physics? The answer is simple — because science is anal retentive.

Science is anal by nature. It holds up a yardstick and precisely measures everything it can. From these measurements we can deduce and calculate. For example, if we were to measure the height of the Statue of Liberty, we could deduce that it is Really Freekin' Tall (RFT). If we wanted to, we could then calculate how many RFTs it is to the Freekin' Moon. This, of course, is the kind of science practiced by those people who have their thumbs stuck up their butts.

However, if there were enough people with this affliction, the RFT could become a standard. Once a standard, the afflicted could measure all kinds of things in RFTs. In physics, standard units have emerged in much the same way. A unit of measurement was needed and someone pulled one out of the rectal neithervoid. This is honestly how it happens. The meter was declared by measuring the distance from the equator to the north pole and dividing this distance by ten million. In other words, they created the meter by just making it up as they went along.

In accordance with this time-honored scientific tradition, I have taken the liberty to fart units like magic butterflies. These units needed to be created when dealing with 2D physics. It makes it easier to discuss various topics in easy to understand and specialized language. Physics, at its very basic measures three things (electrical charge omitted for this introduction), for which specialized units have been created :

• Length
• Time
• Mass

## Length

Length is nothing more than the distance from point A to point B. Because we cannot hold the standard yardstick up to our screen and measure any distance from point A to point B, another way has been devised that suits 2D games.

• The fundamental unit of length in 2D video games is the pixel.

No surprises there. However, some things will be measured and are able to move in units of less than a pixel. Therefore, any measurement less than a pixel is generically known as a subpixel. Also, where using a metric-imitation has made the text easier to read and understand, I have used these units of length :

Unit Length in Pixels Another way to say it..
centipixel 0.01 1/100th of a pixel
millipixel 0.001 1/1000th of a pixel
kilopixel 1000 1000 pixels

## Time

Time in 2D game space passes in a fundamental measurement called the loopin (abbrev. lpn).

• A loopin is the time it takes for your game to proceed through one game loop.

This is because so much game code, especially dealing with physics, is executed once per game loop. Actual time as experienced by you is relative to the loopin as some game loops can and will take longer to execute to others. No matter how long it takes to process a game loop, the game code will only have registered that exactly one loopin has passed.

In discussing movement, the abbreviation ppl has been used. The abbreviation stands for pixels per loopin.

## Mass

Let's face it. Mass is non-existent in 2D video games. While volume can be calculated using height and width (measurements of length), a pixel will always have a weight of nothing. Zero. Zip. Nada. Instead, we have to simulate weight.

In simulating weight, making sure that a penguin really weights as much as a real penguin is completely unimportant. What is important is the ability to say how heavy objects are so that math can be applied in the first place.

In order to do this, I will use a simple metric format. Therefore the gram is the standard of 2D weight in this minibook. Here's the chart :

Unit "Weight" vs. Gram
milligram 0.001
gram 1
kilogram 1000
metric ton 1,000,000
page revision: 13, last edited: 15 Jul 2012 02:17