Hot answers tagged

2

You are only checking th i-th bullet with the enemy of the same index and not with every enemy there is. You should do something like this for (int i = 0; i < Bullet.Bullets.Count; i++) { for (int j = 0; j < Enemy.Enemies.Count; j++) { if (Collisions.IsColliding( (int)Bullet.Bullets[i].position.X, ...


2

A couple of things: You should avoid creating, and recreating the Color arrays. Find a way to create them once and avoid GC. The textures are not generated by the GPU and won't force it to synchronize with the CPU, but you should avoid copying and/or sifting through it on the CPU if at all possible. As a direct answer to your question, the Rectangle ...



Only top voted, non community-wiki answers of a minimum length are eligible