mmm i must getting tired laugh Bassicly i want to play a sound every time
my player does an attack move. If i add the snd_play i get the
annoying echo or the player gets stuck in the animation.


Here's my player movement for tonight i give up i really need some sleepzzzzz
Although i am happy that i accomplished the movement today laugh learned something at least laugh


Code:
action player_code() // attach this action to your player
{
	var movement_speed = 10; // movement speed
	var anim_percentage;
	VECTOR temp;
	player = my; // I'm the player
	while (1)
	{
		
		vec_set (temp.x, my.x); // trace 10,000 quants below the player
		temp.z -= 3000;
		temp.z = -c_trace (my.x, temp.x, IGNORE_ME | IGNORE_PASSABLE | USE_BOX) + 4; // play with 20
		temp.x = movement_speed * (key_w - key_s) * time_step;
		temp.y = 0;
		c_move (my, temp.x, nullvector, IGNORE_PASSABLE | GLIDE);
		if (!key_w && !key_s) // the player isn't moving?
		{
			ent_animate(my, "idle", anim_percentage, ANM_CYCLE); // play the "stand" animation
			anim_percentage += 2 * time_step; // 5 = animation speed
		}
		else // the player is moving?
		{
			
			ent_animate(my, "walkr", anim_percentage, ANM_CYCLE); // play the "walk" animation 
			anim_percentage += 4 * time_step * (key_w - key_s);			
		}
		{
			if (key_c ==1 )			
			{
				ent_animate(my, "attack", anim_percentage, ANM_CYCLE); // play the "walk" animation
				anim_percentage += 3 * time_step; // 8 = animation speed	
											
			}
			if (key_v ==1 )
			{
				ent_animate(my, "attackk", anim_percentage, ANM_CYCLE); // play the "walk" animation
				anim_percentage += 3 * time_step; // 8 = animation speed		
			}
			if (key_b ==1 )
			{
				ent_animate(my, "atackkk", anim_percentage, ANM_CYCLE); // play the "walk" animation
				anim_percentage += 3 * time_step; // 8 = animation speed				
			}
			if (key_f ==1 )
			{
				ent_animate(my, "attackkkk", anim_percentage, ANM_CYCLE); // play the "walk" animation
				anim_percentage += 3 * time_step; // 8 = animation speed					
			}
			if (key_g ==1 )
			{
				ent_animate(my, "attackkkkk", anim_percentage, ANM_CYCLE); // play the "walk" animation
				anim_percentage += 1 * time_step; // 8 = animation speed					
			}
			if (key_g ==1 )
			{
				ent_animate(my, "attackkkkkk", anim_percentage, ANM_CYCLE); // play the "walk" animation
				anim_percentage += 1 * time_step; // 8 = animation speed						
			}
		
			if (key_u ==1) 
   		{
				ent_animate(my, "jump", anim_percentage, ANM_CYCLE); // play the "walk" animation
				anim_percentage += 1 * time_step; // 8 = animation speed		

				
			
		
         
          }
          wait(1);
          }
         
        }
        }



Last edited by Realspawn; 06/10/11 23:51.

Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain