action ...
{
while(1)
{
if(vec_dist(my.x,player.x) < 32)
{
if(key_e)
level_load
...
The thing is (I might be wrong) that all instructions in those brackets (key_e) will run till loop is actually running.
You don't want to change your level endlessly, right?
You could insert 'break' after 'level_load', but that's not a good idea (probably), but it will work for sure!
Greets