Learn Create Your Own Split Screen

Next Page

Currently, the speed is related to the distance. If you've got something in a mathematical formula, and you want to get rid of it, you divide by it. For example in algebra, '23a' divided by '23' is just 'a' -- no more 23.

So all we need to do is divide by the actual distance the sprite needs to travel.

To calculate the distance, we rely on another 2000 year-old Greek dude:


You may have been wondering over recent years why you've been taught so much about triangles and 2000 year-old Greek dudes, and now you know the answer -- it's so you can write awesome games.