Most programming languages come with native functions that help us round our numbers, either upwards (i.e. **ceiling** operation), downwards (i.e. **floor** operation), or to the nearest whole (i.e. **round** operation). While this is convenient, we sometimes need a bit more than that — what if — for example — we want to round our numbers to the nearest 0.5, or the nearest 3^{rd}?

# Tag: maths

### All posts by :

# Unity Rigidbody’s Interpolate property

If you looked at the properties available for configuration on a Unity **Rigidbody** and poured through the documentation for it, you’ll likely find that most of its properties are pretty easily to understand, with the exception of **Interpolate** and **Collision Detection**. We’ve explored what the Collision Detection properties do in another article on this blog, and we’re going to explore the **Interpolate** property in this article.

# Vector math for polar movement in 2D games (Unity)

Polar movement, i.e. moving objects at an angle, is something that people starting out in games programming often have trouble with. Coordinate systems are easy to understand, and so is moving things left and right or up and down; but what if you want to move at angles that are not parallel to an axis, like 30° upwards, or towards a target? How do you get a vector that represents that direction of movement?

Continue reading# Coding projectiles for your tower defense game — Part 2

In the second part of this series, we will be exploring how to give our projectiles a nice vertical arc as they travel towards the target. This article will expand upon the work in Part 1, where we coded a projectile that could home in onto the target and detect collision with the target without using Unity’s physics engine’s.

Continue reading