Hey guys and gals,
I have a jump question, I have a jump when I press the space bar and I thought that I have it set to when it reached a height it would reset the button to the point where I could hold the button and the jump animation would play once and not continue to bounce while holding the button. Any help is appreciated.
Code:
if(key_space == 1 && !reached_height)
   {
   	my.ANIMATION = 0;
		my.STATE = 7;
	   reached_height = 1;
	  
   }
    
   if(my.STATE == 7 && dist_down ==-1)
	{
		 my.ANIMATION = 0;
	    my.STATE = 9;
	    reached_height = 0;	
	}



The states are the jumping states and the landing states and they hold the animations that are associated with it.
Here is the jump code to move the player into the air.
Code:
if(key_space == 1)
	      {
	      	jump_target = jump_height * time_step;
	     
	     	   
	      }


I was helped courtesy of DarkInferno. Got to give credit where credit is due.