• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Game freezes after half a second [SOLVED]

R

Raphael Caloz

Guest
Hi there,

I'm having an issue with my game that I can't quite get my head around.

After running for half a second, my game freezes (all animations and movement stop), but the background music keeps playing. What is strange is that the console does not output any error. EVEN MORE BIZARRE : I when I press the left mouse button, the shooting sound plays! Here is the console's output :

Attempting to set gamepadcount to 12
DirectX11: Using hardware device
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
ENEMY CREATE.
Total memory used = 10356830(0x009e085e) bytes
Attempting to set gamepadcount to 0
---------------------------------------------------------------
minFPS, maxFPS, avgFPS
-30, 0, 0
---------------------------------------------------------------
---------------------------------------------------------------
minFPS, maxFPS, avgFPS
-30, 0, 0
---------------------------------------------------------------
X://windows/Runner.exe DONE (0)
Igor complete.
 
R

Raphael Caloz

Guest
This might help someone out, so here is how I fixed it :
I changed this :

//End level
if (points > 50)
{
room_goto(rm_shop);
x = 510;
y = 544;
}

-------------------------------------------------------

To this :

//End level
if (points > 50)
{
points = 0;//SOLVE BUG :D
room_goto(rm_shop);
x = 510;
y = 544;
}


So essentially the code was switching rooms every single frame, which made it look like the game was frozen.
 
Top