• 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!

Exponetial growth makes my game crash with no error message

A

alberted

Guest
In my game I have this line of code at the top of the create event for the enemies in my game:
GML:
size=random_range(0.5,oplayer.thl*3)
The code determines the size of the enemy. The maximum size of the enemies is suppose to grow through out the game. If I make the maximum size grow linearly, it works fine, however, it's suppose to grow exponentially. I've tried to program it a million different ways but when I make it grow exponentially, it just doesn't work, and i have no idea why. The code above is my latest try. The maximum size is essentially decided by a variable from another object, which grows exponentially. However, i've tried many completely different methods, and none of them work.
The game always shuts down about 30 seconds to 2 minutes into the game, and the only error message i get is "FAILED: Run Program Complete".

Can anybody help?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
That code you posted should not under any circumstances cause the game to finish running. Have you got a game_end call in there by mistake or something by any chance? Also, you can add a breakpoint to that line of code then check the value and step through the code to see if that is indeed where the game is crashing and what value it actually holds.
 
Top