OK - I`ve got the while and y-problem, but now there is another. ENTITY still doesn`t find the right position. Please take a look to the vid (just 746 kb)

http://www.open-beats.de/temp/galaga_move_problem.wmv

In STATE 7 I put ENTITY without moving on their target position. You can see that ENTITY is far away from target postion at the end of moving to target in STATE 4.

BTW there is no STATE 5 and STATE 6. It`s free for additional moving laugh

THANKS Ditje

Edit: Maybe this pic helps to understand, what I want laugh



Code:
if(my.STATE == 4)
			{
				var temp;
				vec_set(temp, vector(epos[my.ENEMID][0], epos[my.ENEMID][1], epos[my.ENEMID][2]));
				vec_sub(temp, my.x);
				vec_to_angle(my.pan, temp);
				if(vec_dist(my.y, vector(epos[my.ENEMID][0],epos[my.ENEMID][1],epos[my.ENEMID][2])) > 2)
				{
					if(me.y < 800)c_move(me, vector(0,0,0),vector(0,enemy_speed*time_step,0), IGNORE_ME | IGNORE_PUSH);
					else my.STATE = 7;
				}
			}
			if(my.STATE == 7)
			{
				// Drehungen zurückstellen - Endposition
				me.pan = 0;
				me.tilt = 0;
				me.roll = 0;
				me.x = epos[my.ENEMID][0];
				me.y = epos[my.ENEMID][1];
				me.z = epos[my.ENEMID][2];
				// zusätzliche Gegner entfernen
				if(my.ENEMID > 40) ent_remove(me);
				return;
				my.STATE = 8;
			}



Last edited by Ditje; 08/11/10 11:16.