Video Game Design and Development

Encouragement, advice, and support for aspiring game designers.

  • Schools
    • Online Schools
    • Game Design Schools
    • Game Design Majors
    • Graphic Design Schools
    • Canada Game Design Schools
    • Art Schools in The USA
    • States
  • Development
    • Game Programming Languages
    • Game Development Software
    • Texture Packager
    • Roblox Coding 101
    • Gaming in C ++
    • Video Game Engines Guide
    • How to Make a Game Engine
    • Unreal Game Engine
    • Unity vs Unreal
    • Unity vs Godot
    • Java
    • Cross Platform Games
  • Careers
    • Become a Game Designer
    • Education Requirements
    • Game Design Document
    • Video Game Ideas
    • 3D Modeler
    • Game Artist
  • Animation
    • Animation School Rankings
    • 2D Animation Software
    • New York Animation
    • California Animation
    • Animation in Canada
  • Free Course
    • GameMaker
    • Unity
You are here: Home / Learn / Math in Video Games: The Role of Mathematics in Game Programming

Math in Video Games: The Role of Mathematics in Game Programming

math in game design and programmingWe are reader-supported. Purchases made through links on our site may earn us a commission. Learn More.

Beneath all those cool character animations, smart enemies, and fun game mechanics in your favorite games is one thing: math in video games.

Math in video games is the foundation of every game and necessary for everything to work as the designers intended. I remember the first time I realized this while coding a Pong clone in college—the paddle wouldn’t move correctly until I fixed the math behind its speed and angle. That moment proved how math is at the core of even the simplest mechanics.

This doesn’t just include huge games like Middle Earth: Shadow of Mordor and its enemy-generating Nemesis system.

Even Pac-man employs math to decide how the enemy ghosts move, how long they take to regenerate after being eaten, etc.

Even Pong, arguably one of the simplest games ever made, uses math to dictate the speed of the paddles and movement of the ball.

📌 Key Takeaways

  • Math is the foundation of every video game, from simple classics like Pong to modern titles like Halo and Portal.
  • Core math concepts—algebra, geometry, physics, and algorithms—power game mechanics, movement, and AI.
  • Without math in programming, game engines, graphics, and gameplay wouldn’t function as intended.
  • Even features like procedural generation, pathfinding, and lifelike water rely heavily on math.

Math is the Foundation of Game Design

In the same way that math doesn’t work unless you learn and apply the rules, a video game can’t have rules without math. When you think about it, video games are essentially virtual worlds with lots of rules that keep everything working as intended.

No math means Mario keeps floating up after jumping, bullets in Call of Duty shoot in random directions, and even your favorite character in Angry Birds move in inconsistent ways if it moves at all.

Most of the time the math you learned in high school and college is no different than what was used to design a game.

To name a few, some of the common branches of math utilized in game development include:

  • Algebra
  • Trigonometry
  • Calculus
  • Linear Algebra
  • Discrete Mathematics
  • Applied Mathematics
  • And more …

More specific elements of math almost always used in games include:

  • Matrices
  • Delta time
  • Unit and scaling vectors
  • Dot and cross products
  • And scalar manipulation

Math In Programming

While math is useful even in the art side of game development, it’s the programmers who make use of it to create the characters, mechanics, and more.

Without math in video games, programmers wouldn’t be able to make objects in the game do even the simplest of things, including movement.

Game code combined with variables, vectors, and more is what makes math in video games essential. It’s what tells Sonic to run slowly when the player barely presses the D-pad, run faster at a full dash, stop when hitting a solid object, or move differently underwater.

It’s not hard to see why a game without programming and math in video games would just be a bunch of pretty, useless art.

Together they allow games to simulate our worlds, such as moving water and physics, as well as to deliver something outside real-world possibilities.

Only in Portal can we know what it feels like to step through portals, while only in Halo can we dash at ridiculous speeds to impale a foe with an Energy Sword.

Lifelike water, pathfinding, procedural generation in levels, critical hits, AI in video games that reacts to player input, and even the game engine architecture itself– all of these are not possible for a programmer to do without math. I remember being blown away the first time I played Minecraft—every new world I loaded felt endless. Later, when I learned about the math behind procedural generation, it gave me a new appreciation for how numbers can create infinite possibilities.

If you’re considering a career as a game programmer and even designer, expect math to be your greatest tool for creating worlds that players will enjoy thanks to addicting gameplay that not only works as intended but is fun as well.

Does Programming Require Math?

Yes, to a certain degree.

If you want to have a strong sense of control over programming basics, it’s wise to have at least the basic knowledge of math concepts like logic, algebra, and more. You won’t be required to answer complex math problems while coding, but there will most likely be example problems using math equations, and logic.

How Much Math Do I Need To Know To Code?

This depends because not everything in code needs the programmer to take part in the mathematical process. You won’t be solving equations and going into detail. If you are hung up on numbers and problems, the computer can usually figure out those details.

Math in Video Games

Video games and math are basically interchangeable in how enmeshed they are with each other. Every action you do in-game is due to a math calculation of some sort.

Luckily for us, we harness the power of computer programming to cut away all the complicated math that would take hours to complete by hand. Without math, games wouldn’t be what they are.

Running, jumping, flying, diving, surfing, and basically, any physical activity is governed by some sort of school of mathematics.

Numbers

Everyone knows numbers; they’re what makes our society push onward. The same goes for math in video games. If it weren’t for all of those 1’s and 0’s, we wouldn’t be able to program and create games properly.

Discreteness

This refers to the limits in which certain aspects of gaming have. Discreteness is the opposite of continuous, meaning a neverending set of numbers. In games, we need discreteness to contain and build our game.

Geometry

Geometry in games, the field of math that questions the properties, shape, and size of things in a given space, is vital for math in video games. It’s based on right-angled triangles. The geometry makes up nearly all we see in our video games.

Coordinate Systems

You need to have a concept of where an object is in space and time. We do this by using different numbers to label the coordinates, where the object will take space.

Iteration

This is all about computers repeating themselves. This is a crucial function during the game development process. You can’t have long pauses in gameplay, so you need to split up different portions and make sure they’re all working correctly.

Physics

Another huge area of gaming, physics in gaming, is the broad field of math in video games. Whether your character is hitting a baseball, jumping over a hedge, or shooting at a target, physics plays one of the most prominent roles in games.

Cheating

No, these aren’t video game cheat codes. Cheating refers to using shortcuts in the programming process to make our lives a little easier. This is using mathematical functions to simplify hard functions.

Intelligent Motion

Intelligent motion is the many different algorithms used by enemy characters to undertake specific actions in reaction to the player’s presence. I’ll never forget when I was experimenting with AI behavior in a side project—my enemy character kept charging straight into walls until I applied velocity and acceleration formulas. Suddenly, the AI felt alive, reacting naturally to the player.

Pitfalls

As you can probably guess, pitfalls refer to anything in the coding process that can mess up your code and your game. These are accidental mistakes or bugs within the code.

Questions About Math in Programming

What math do you need for video game design?

It’s recommended that you know the basic concepts of geometry, algebra, some trig, and logic. However, this is different for most people and shouldn’t dissuade you from trying if you don’t know more advanced math.

Is coding harder than math?

It depends entirely on the capabilities of the coder. Some find it much more comfortable.

Can you be a programmer if you’re bad at math?

Yes. Coding isn’t as dependent on harder math concepts as you might think. Many examples used in tutorials and books use these more difficult concepts to illustrate how to do something, which could prove to be an issue.

Being better at math helps you understand more advanced concepts and what they represent.

Books About Math and Programming

Math For Programmers


Math For Programmers

By Paul Orland

This more recent book is filled with fantastic exercises, examples, and helpful math designs to help you net a career in programming.

Orland’s book focuses on exactly what you need to be a successful programmer, data scientist, and machine learning.

Mathematics for Machine Learning


Mathematics for Machine Learning

By Marc Peter Deisenroth

This book is geared towards introducing the reader to what mathematical functions are essential to getting the hang of machine learning. These include calculus, algebra, and analytic geometry.

This book aims to more easily blend different flavors of mathematics into one to teach a programmer or computer science student better the basics of machine learning.

A Programmer’s Guide to Computer Science


A Programmer's Guide to Computer Science

by Dr. William M Springer II

Dr. Springer sets out to ensure the reader knows their basic math for programming and computer science. You’ll get a crash course in some of the most critical topics, including graphs, problem-solving, complexity theory, and graphs.

 

Grokking Algorithms: An Illustrated Guide for Programmers


Grokking Algorithms

By Aditya Bhargava

This more casual and lighthearted guide will be great for visual learners out there. It sets out to easily convey common problems in programming and how to solve them. This, of course, includes a healthy dash of discrete mathematics.

Through over 400 drawings of detailed walkthroughs, you will be better at math programming by the end.

 

Doing Math with Python: Use Programming to Explore Algebra, Statistics, Calculus, and More!


Doing Math with Python

By Amit Saha

This is the perfect starting point for those who want to explore the kind of math for programmers with Python. It gives you projects to work on, emphasizing algebra, probability, and calculus.

 

Math Adventures with Python: An Illustrated Guide to Exploring Math with Code


Math Adventures with Python

By Peter Farrell

This fun book on math programming will show you how to best harness the power of math for programming. You will explore mathematical concepts by using the coding language Python.

 

Foundation Mathematics for Computer Science: A Visual Approach


Foundation Mathematics for Computer Science

By John Vince

John Vince dives right into the nitty-gritty of understanding mathematical concepts to better succeed at computer science, and nail math for programming. He blends how it all applies to math, programming, and the real world, illustrating its importance.

 

Mathematical Structures for Computer Science


Mathematical Structures for Computer Science

By Judith L. Gersting

In this hefty tome, readers will be introduced to the exciting and multifaceted relationship of math programming. With a gentle pace through the chapters, you will feel familiar with the material by the end.

 

Mathematical Programming: Theory and Methods


Mathematical ProgrammingBy S. M. Sinha

This book covers everything from linear programming to its implementation in our daily lives. Readers will get a clear picture of what the marriage of math and programming is like. There are detailed and challenging proofs for you to explore and hone your skills.

 

Mathematics & Physics for Programmers


Mathematics & Physics for ProgrammersBy Danny Kodicek

This guide is aimed at programmers who want to make the most out of mathematical education. This also includes physics for game developers. This is an excellent resource for math programming and has further use for game developers.

 

Introduction to Applied Linear Algebra: Vectors, Matrices, and Least Squares


Introduction to Applied Linear Algebra

By Stephen Boyd

This intro text to algebra is perfect for math programming. Although it may be a starter text, this outlines all you need to know when programming while using mathematical concepts.

 

 

Discrete Mathematics


Discrete Mathematics

By Gary Chartrand

Chartrand makes the topic of discrete mathematics more accessible. With knowledge of discrete mathematics, calculus, and algebra, you can better apply it to programming. It’s a relaxed and casual read about a denser subject.

 

 

An Introduction to Formal Languages and Automata


An Introduction to Formal Languages and Automata

By Peter Linz

What better way to enhance your programming math skills than by going in-depth with the pillars of computer science? Peter Linz goes smooth on the reader here, not bogging you down with mathematical jargon.

 

Algorithms Illuminated: Part 1: The Basics


Algorithms Illuminated - Part 1 (The Basics)

By Tim Roughgarden

Familiarizing the reader with the very essence of computer science, Tim Roughgarden aims to make the reader a better programmer through his excellent guide through algorithms and technical skills.

 

 

The Art of Doing Science and Engineering: Learning to Learn


The Art of Doing Science and Engineering

By Richard W. Hamming

This is a more conceptual text aimed at tailoring your thought process towards different problems in logic, math, and programming. This is a fantastic resource to gain scientific inspiration from.

 

 

 

📌 Actionable Next Steps

If you’re just starting out, begin by learning the basics of algebra, geometry, and logic, since these are the building blocks of coding and game design. Explore beginner-friendly resources like Doing Math with Python or Grokking Algorithms. Then, try small coding projects that apply math in video games—like creating simple movement mechanics or AI behavior. Building step by step will give you the confidence to tackle more advanced concepts.

FAQ

How is math involved in video games?
Math powers everything in video games, from movement and physics to AI reactions and game engine design. It controls how characters jump, how enemies respond, how water flows, and even how levels are generated. Without math in programming, games would just be static art without interactivity.

What video games use math?
All video games use math, whether simple or complex. Pong relies on math for ball and paddle movement, Pac-Man uses it for ghost behavior and respawn timing, and modern titles like Portal and Halo depend on advanced physics, vectors, and algorithms for gameplay mechanics.

Do you need math for video games?
Yes, at least a basic understanding. Core concepts like algebra, geometry, logic, and physics are essential for coding mechanics, building AI, and designing levels. While advanced math isn’t always required, stronger math skills help programmers create more complex and realistic gameplay.

What is gaming math?
Gaming math refers to the mathematical concepts behind how games function—things like geometry for environments, coordinate systems for object placement, physics for movement, and algorithms for AI or procedural generation. It’s the foundation that makes gameplay possible.

Sources Utilized

  • https://www.gamedeveloper.com/design/going-rogue-like-when-to-use-procedurally-generated-environments-in-games
  • https://digitalcommons.uri.edu/cgi/viewcontent.cgi?article=3006&context=theses
  • https://en.wikipedia.org/wiki/Galactic_Arms_Race
  • https://en.wikipedia.org/wiki/Ultima_Ratio_Regum_(video_game)
  • https://en.wikipedia.org/wiki/Hunter%27s_Moon_(video_game)
  • https://www.researchgate.net/publication/385515765_Statistical_mathematics_in_video_games
  • https://www.ewadirect.com/proceedings/tns/article/view/16523
  • https://www.pcgamer.com/software/ai/the-boffin-behind-valves-steam-labs-says-the-number-of-steam-releases-featuring-genai-in-2025-is-1-in-5-with-7-percent-of-all-games-on-there-now-incorporating-it-weve-octupled-last-years-figure
  • https://www.tomshardware.com/video-games/pc-gaming/1-in-5-steam-games-released-in-2025-use-generative-ai-up-nearly-700-percent-year-on-year-7-818-titles-disclose-genai-asset-usage-7-percent-of-entire-steam-library
  • https://www.pcgamer.com/software/ai/87-percent-of-game-developers-are-already-using-ai-agents-and-over-a-third-use-ai-for-creative-elements-like-level-design-and-dialogue-according-to-a-new-google-survey
  • https://www.sciencedirect.com/science/article/pii/S1875952120300625
  • https://arxiv.org/abs/2007.01910
  • https://dl.acm.org/doi/10.1145/3290607.3299030
  • https://ieeexplore.ieee.org/document/9051091
  • https://journals.sagepub.com/doi/10.1177/1046878119835782
  • https://press.rebus.community/introgamedev/chapter/math-for-game-development
  • https://link.springer.com/chapter/10.1007/978-3-031-05637-6_7
  • https://pubsonline.informs.org/doi/abs/10.1287/ited.2018.0215
  • https://www.frontiersin.org/articles/10.3389/feduc.2021.734857/full
ShareTweet

Written by Dustin Tyler - Updated on September 9, 2025

Popular Posts

Basic Game Elements
Master These Game Elements To Elevate Your Game
how to use player feedback in game designing
When Is The Right Time To Ask For Gamers’ Feedback?
video game storytelling guide
Video Game Storytelling: How to Write Engaging Stories

About Dustin Tyler

Initially focused on web dev, Dustin was introduced to game design by a friend after college and was immediately attracted to the combination of technical skill and creativity required to make an awesome game.

He’s utilized his web dev skills and desire to help others by creating a resource where expert game designers can share what they’ve learned with the next generation of aspiring game makers.

Table of Contents

  • 📌 Key Takeaways
  • Math is the Foundation of Game Design
  • Math In Programming
  • Does Programming Require Math?
  • How Much Math Do I Need To Know To Code?
  • Math in Video Games
    • Numbers
    • Discreteness
    • Geometry
    • Coordinate Systems
    • Iteration
    • Physics
    • Cheating
    • Intelligent Motion
    • Pitfalls
  • Questions About Math in Programming
    • What math do you need for video game design?
    • Is coding harder than math?
    • Can you be a programmer if you’re bad at math?
  • Books About Math and Programming
    • Math For Programmers
    • Mathematics for Machine Learning
    • A Programmer’s Guide to Computer Science
    • Grokking Algorithms: An Illustrated Guide for Programmers
    • Doing Math with Python: Use Programming to Explore Algebra, Statistics, Calculus, and More!
    • Math Adventures with Python: An Illustrated Guide to Exploring Math with Code
    • Foundation Mathematics for Computer Science: A Visual Approach
    • Mathematical Structures for Computer Science
    • Mathematical Programming: Theory and Methods
    • Mathematics & Physics for Programmers
    • Introduction to Applied Linear Algebra: Vectors, Matrices, and Least Squares
    • Discrete Mathematics
    • An Introduction to Formal Languages and Automata
    • Algorithms Illuminated: Part 1: The Basics
    • The Art of Doing Science and Engineering: Learning to Learn
  • 📌 Actionable Next Steps
  • FAQ
  • Sources Utilized

Recent Posts

  • How to Build a Game Design Skill Tree
  • Yellow Paint in Game Design
  • How to Use Animation Storyboards
  • What is Cel Shading & How to Use It?

Site Info

  • About Us
  • Cite this Website
  • California Consumer Privacy Act
  • Editorial Guidelines


DMCA.com Protection Status

Categories

  • Game Design Education
  • Game Design Careers
  • Game Engines
  • Animation 
  • Technology
  • Learn Skills
  • Ask an Expert
  • Graphic Design
  • Free Mini-Courses

Connect

  • Contact Us
  • Facebook
  • Twitter
  • Youtube
  • Pinterest
  • Our GameMaker Course

Send us mail:

Lake House Media
7910 4TH ST N
STE 300
ST. PETERSBURG, FL 33702

Copyright © 2025 · Privacy Policy · Terms · Earnings Disclaimer