Tagged Questions
2
votes
1answer
337 views
High CPU usage on Pong clone
I just made my first game, a clone of Pong, using OpenGL and C++. But its using ~50% of the CPU, which I guess is very high for a game like this. How can I improve that? Can you please look up my code ...
1
vote
2answers
441 views
Checking collision in an array - is there a better way?
MSDN suggested this, but I'm worried about it slowing down the game when there are a lot of objects to check:
for (int i = 0; i < enemy.Length; i++)
{
if (enemy[i].isActive)
{
...
6
votes
4answers
1k views
Is there a way to increase the collision check efficiency of a system of n objects?
I'm making a game that consists of many onscreen objects, one of which is the player. I need to know which objects are colliding every iteration.
I made something like this:
for (o in objects)
{
...
6
votes
2answers
1k views
How do I find the point of impact with 2D per-pixel collision detection?
I'm creating a platformer and have implemented per-pixel collision detection. However, this has caused 2 obstacles that I've yet to figure out. The first obstacle, which this question is about, is ...
11
votes
1answer
1k views
Quad trees/grid based collision - putting logic into action
First of all, I've only been writing my own game logic for a short while, so I apologize if this might seem straight forward.
I've been reading a lot about quad trees and grid based collision ...
4
votes
3answers
2k views
Why do we use physics engines for collision testing or raycasting?
There is a thing I don't understand about game engines: why it is so common to use physics engines to do raycasting or collision testing?
Say that you have a 3D scene loaded in your scene manager ...