Skip to content

Movement and Physics

Overview

Almost every 2D game moves something. This document covers the vector math foundation, basic numerical integration for velocity/position, and simple friction/drag models. These are the building blocks everything else (collision, camera, AI) sits on top of.

Core Algorithms (Pseudocode)

Vector Operations

Linear Interpolation (Lerp) Euler Integration (basic physics step) Friction Drag

The Math

Vector Operations

Vector Operations

Linear Interpolation (Lerp)

Euler Integration (basic physics step)

Friction Drag