[XNA] Collisions (and a general update)
One of the coolest things in older video games (read: Asteroids) for me was the wrap: The sprite moves off the screen and smoothly appears on the far side. Imagine my crippling disappointment this morning when I started playing around will collision detection and discovered that it is basically eight lines of code:
if (rectangle1.X + rectangle1.Width < 0) rectangle1.X = gameWidth; if (rectangle1.X > gameWidth) rectangle1.X = 0 - rectangle1.Width; if (rectangle1.Y + rectangle1.Height < 0) rectangle1.Y = gameHeight; if (rectangle1.Y > gameHeight) rectangle1.Y = 0 - rectangle1.Height;
Beyond this, the project is slowly coming together. I’ve created several learning sub-projects in order to come up to speed with different facets of the project. The end is starting to come into sight, but the biggest work will be in tying everything together into a moderately-polished game.