1

A serious bug has popped up and I don't have a clue why. Not long after I start my game, the game freezes. All I know is that the program execution goes into world.step(1.0f/30.0f, 5, 2); and never exits, thus freezing the game (By never, I mean no visible change has occurred for more than a minute, and for this application it may as well be forever). I've been working on this for a while and this hasn't happened before, but now it happens every time within seconds of starting.

Anyone have any idea why this might happen?

Sadly, in an event like this, I kinda wish I was using version control.

Jesse Jashinsky
  • 10,313
  • 6
  • 38
  • 63

1 Answers1

1

I found the problem. For some reason it was this method (And another like it) that caused the problem.

    public Vec2 getRWallCenter()
    {
        Vec2 v = rWall.getPosition();
        float scale = purpleRadius / 2;
        v.set(v.x * scale, v.y * scale);

        return v;
    }

Could it be that when I tried to scale v to screen coordinates, I was actually modifying the wall's vector? Perhaps I could try cloning the vector.

Jesse Jashinsky
  • 10,313
  • 6
  • 38
  • 63
  • Yes, the position you grabbed is the one that's used for the position of the wall, so modifying it will change the wall's position. So don't do that haha. – Daniel Murphy Mar 13 '12 at 14:15