
Use math to polish games and create eye-catching 2D visual effects through an intuitive, visual approach. Implement screen shaking and animation with high school level math, assuming C++ basics.
Install python from python.org, add it to your path, and verify with python --version. Prepare to download the source code in the next lecture.
Download and unzip the arcade app source, use premake to generate project files, and build to run the asteroid game with arrow controls and missiles.
Review the Asteroids game code, examining the main logic in asteroids.h and CBP, the ship and laser, ray 2D, easing utilities, screen, and animated button for exercises.
Learn how this course uses video exercise lectures to cover required code and stubbed functions, with no posted solutions to encourage deliberate practice and math concept mastery.
Explore how sine and cosine drive game oscillations by adjusting amplitude, period, frequency, y offset, and x displacement, and reveal their equivalence up to a pi/2 offset for pulse functions.
Discover why game developers favor radians over degrees and how the unit circle defines radians by arc length on the unit circle, with pi equating to 180 degrees.
Explore how sine and cosine relate to the unit circle and right triangles, with x equals cosine theta and y equals sine theta, enabling rotation in game development.
Refresh your understanding of 2D vectors in game dev, covering magnitude, direction, components, and operations like addition, subtraction, negation, scaling, and unit vectors, with points, distances, and perpendicular vectors.
Apply the dot product to measure vector similarity and projection, producing a scalar that reveals direction, front‑behind relations, and the angle between vectors.
Explore how matrices enable moving between coordinate spaces by applying column-major transformations to 2D vectors, using basis vectors and rotation concepts for world and player spaces.
This lecture demonstrates implementing a pulse effect to flash power-ups as their lifetime nears end, using sine-based oscillation, time, and alpha modulation.
Explore rotation via the unit circle, where x is cosine theta and y is sine theta, forming the rotation matrix. Rotate around the origin, then translate around an arbitrary point.
Implement a screen shake that activates when missiles hit asteroids, updating the shake timer and applying sine and cosine offsets. Ensure asteroid constants enable screen shake.
Learn how to bounce a ball off a wall using vector reflection, with velocity vectors, the wall normal, dot products, and a reflect method in a breakout-like setup.
Normalize values to the 0 to 1 range using min-max scaling (subtract min, divide by max minus min). Apply to animations and games, leveraging unit vectors and dot products.
Learn linear interpolation using l(t) = (1-t)A + tB with t in [0,1], moving from A to B, applicable to colors or positions in a linear, even way.
Explore easing functions and how changing the t parameter within 0 to 1 creates ease-in, ease-out, and smoothstep curves for animations, with quadratic and bounce examples and practical implementations.
Learn uv mapping to apply textures to game objects using uv space, normalize to 0–1, and fetch texels from sprite sheets, enabling rotation and scale without extra images.
Apply alpha blending in 2d games using linear interpolation between destination and source colors. Normalize the source alpha to 0–1 and use evaluate one minus source alpha to blend transparency.
Learn how the animated button class uses a pulse to drive alpha-based highlights, text bouncing, and color flashing between teal and orange, driven by a simple update-time animation loop.
Learn how bilinear filtering smooths textures by interpolating along x and y using neighboring texels, based on UV coordinates and sprite size, including border adjustments to sample correctly.
Implement the smooth step function in the easing stance cbp file by translating the easing functions from the lecture, and reference the formula to ensure accuracy.
Implement a gradient function that smoothly transitions between two colors using gradient params, supporting left-to-right, right-to-left, bottom-to-top, and top-to-bottom directions, applied via the overlay color on animated buttons.
Animate each character of the button title using per-letter data, with three methods (set up, update, draw) and a 0.5 second duration; disable bounce and explore left-to-right and reverse directions.
Rays define a direction from an origin extending infinitely, expressed as origin plus direction times t, derived from vector form of interpolation and used for collision detection and ray tracing.
Explore vector representations of circles for collision detection, using the center and a point difference to set a radius, and extend to spheres while preparing for the quadratic equation.
Apply the quadratic equation ax^2+bx+c=0 to find roots with (-b ± sqrt(b^2-4ac))/(2a), as shown by x^2-1=0 yielding -1 and 1, and see how it intersects rays and circles for collisions.
Explore ray-circle intersections for collisions by substituting the ray into circle equation to form a quadratic, solving for t, and interpreting discriminant (two, one, or no intersections).
Explain how to implement laser ray-asteroid intersections using a circle bound, discriminant, and t values, integrate with ship ammo, and prepare for asteroid splitting in the final assignment.
Implement the asteroid split by the ship laser, drawing two halves that fade and move apart from the hit point using world-space split points and UV space orientation.
Celebrate completing the course and see how math powers game development, with encouragement to re-engage and learn vectors, matrices, and quaternions, plus the free 3D Math Primer book.
Video games need math to work - there's no getting around it. 2D and 3D graphics, AI, sound, animations, physics are all applications of math and knowing how the core principles of math work is required in order to have a good grasp on all of them.
We're going to learn core math concepts used in game development. Unlike other courses that teach math, we're going to apply the math we learn by programming challenging exercises to achieve interesting effects in 2D graphics and animation that give real polish to our game - Asteroids. These techniques are fundamental and can be used for a variety of applications through all of game development.
This isn't a typical a boring math class where I write equations on the board. Pretty much all of the math lectures and applications use fun animations that give you a good VISUAL intuition behind the math. This is more important than just memorizing formulas like you did in high school. I show you why a math concept is important, the intuition behind it through fun animations, the applications of the concepts in a real game you'll have the source code to, THEN you'll use those concepts to make the game even better by applying your knowledge to make fun 2D graphic effects.
In the course you'll learn:
Sine and Cosine
Radians
Linear Interpolation
Vectors
Rays
How to apply your math knowledge
Lots more!
By the end of the course, you'll have a better understanding of how to apply math in video games and the intuition behind core math concepts in games. You'll even have enough math knowledge to figure out how to cut an asteroid in half!
There’s no risk!
This course comes with a full 30 day money-back guarantee. If you are not completely satisfied with the course, Udemy will refund you what you paid - no questions asked.
Register for the course today!