Get $500+ of the best After Effects files, video templates and music for only $20!

Browsing Tag

math

Pixel-Level Collision Detection Based on Pixel Colors

Pixel-Level Collision Detection Based on Pixel Colors

In this tutorial, I’ll follow the approach suggested by Richard Davey (Thanks, Richard!), and used by him and others, in detecting collisions between bitmaps with a subtle modification. I’ll also compare performance between various approaches of bitmap collision detection using Grant Skinner’s PerformanceTest harness.


This entry is part 13 of 14 in the Shoot-’Em-Up Session
Predicting Collision Points With Math in AS3

Predicting Collision Points With Math in AS3

In my previous tutorial about collision detection between a circle and a line, I covered projection on a line using the dot product of a vector. In this tutorial, we shall look at the perpendicular dot product and use it to predict the point of intersection for two lines.


This entry is part 7 of 8 in the Collision Detection and Reaction Session
Pixel-Level Collision Detection for Transformed Graphics

Pixel-Level Collision Detection for Transformed Graphics

In the previous tutorial, we went through the basics of pixel-level collision detection. In this tutorial, we shall explore the use of matrices in better defining the area of interest – very useful for graphics that have been rotated, translated, or skewed.


This entry is part 6 of 8 in the Collision Detection and Reaction Session
Simple Harmonic Motion and Its Applications in Games – Tuts+ Premium

Simple Harmonic Motion and Its Applications in Games – Tuts+ Premium

Premium members: here’s this week’s tutorial. Simple harmonic motion is a type of movement commonly used to describe pendulums and springs. In this tutorial, you’ll learn the concepts behind this type of motion, and understand the many different ways you can apply this in your games: from an animated health warning, to the motion of attacking enemy ships.

Understanding Affine Transformations With Matrix Mathematics

Understanding Affine Transformations With Matrix Mathematics

Inspired by Prof. Wildberger in his lecture series on linear algebra, I intend to implement his mathematical ideas with Flash. We shall not delve into the mathematical manipulation of matrices through linear algebra: just through vectors. This understanding, although diluting the elegance of linear algebra, is enough to launch us into some interesting possibilities of 2×2 matrix manipulation. In particular, we’ll use it to apply various shearing, skewing, flipping, and scaling effects to images at runtime.


This entry is part 11 of 12 in the You Do The Math Session
Pixel-Level Collision Detection

Pixel-Level Collision Detection

Up until now, our collision detection methods have been mathematically based. Although this is helpful, there are cases where the mathematical approach is just not worth it, such as with an irregular, organic shape – the computations required are too complex and expensive to justify. Instead, we can check each individual pixel of the shapes. This is also an expensive approach, but it can at least be optimised.


This entry is part 5 of 8 in the Collision Detection and Reaction Session
Quick Tip: Collision Reaction Between a Circle and a Line Segment
basix

Quick Tip: Collision Reaction Between a Circle and a Line Segment

In the previous Quick Tips, we’ve looked at collision detection: essentially, detecting that two shapes have overlapped. Now, we’re ready to look at collision reaction: making something happen due to a collision. In this Quick Tip, we’ll look at the reactions of reflection and sliding.


This entry is part 4 of 8 in the Collision Detection and Reaction Session
Quick Tip: Collision Detection Between a Circle and a Line Segment
basix

Quick Tip: Collision Detection Between a Circle and a Line Segment

We covered collision detection between an infinite line and circle in our previous Quick Tip. However, the issue that arose was that the line extends further than the visible line segment; in fact, it extends into a hyperplane. In this Quick Tip, we shall limit our collision detection to that of a line segment only.


This entry is part 3 of 8 in the Collision Detection and Reaction Session
Quick Tip: Collision Detection Between a Circle and a Line
basix

Quick Tip: Collision Detection Between a Circle and a Line

In my previous Quick Tip, we looked at the idea of collision detection in general, and specifically at detecting collisions between a pair of circles. In this Quick Tip, we’ll look at detecting a collision between a circle and a line.


This entry is part 2 of 8 in the Collision Detection and Reaction Session
Euclidean Vectors in Flash

Euclidean Vectors in Flash

Twice a month, we revisit some of our readers’ favorite posts from Activetuts+ history. This week’s retro-Active tutorial, first published in April, is a guide to Euclidean vectors: what they are, why you’d use them, and how to implement them in Flash with AS3.

Euclidean vectors are objects in geometry with certain properties that are very useful for developing games. They can be seen as points, but they also have a magnitude and a direction. They are represented as arrows going from the initial point to the final point, and that’s how we will draw them in this article.


This entry is part 7 of 12 in the You Do The Math Session
Page 1 of 212