alles ab key_space musst du nur in die while schleife machen

edit:

hier, wie es aussehen muss:

Code:
action player_fight // attached to the player
{
player = me; // I'm the player
player.healthpoints = 100; // and I have 100 health points
while (player.healthpoints > 0) // as long as I'm alive
{
camera.x = player.x - 150 * cos(player.pan); // 200 = distance between the player and the camera
camera.y = player.y - 150 * sin(player.pan); // same value here
camera.z = player.z + 20; // above the player
camera.pan = player.pan; // looks in the same direction with the player
camera.tilt = -12; // look down at the player

my.pan += 5 * (key_a - key_d) * time - 60 * mouse_force.x * time; // rotates with the keys A and D or with the mouse
player_distance.x = 20 * (key_w - key_s) * time; // moves forward / backward with W / S
player_distance.y = 0;
player_distance.z = 0;

if (key_space == 1) // if we press the space button
{
ent_cycle("jump", my.skill22);
my.skill22 += 5 * time;
wait (1);
if(jumping_mode == 1) {
}
if(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
(jumping_mode == 0) {
if(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}
if(z_force > -20) { z_force -= 3 * time; } ELSE { z_force = -20; }
}
if ((key_w == 1) || (key_s == 1)) // the player is walking
{
ent_cycle("run", my.skill20); // play walk frames animation
my.skill20 += 5 * time; // "walk" animation speed
if (my.skill20 > 100) {my.skill20 = 0;} // loop animation
}
else // the player is standing
{
ent_cycle("stand", my.skill21); // play stand frames animation
my.skill21 += 2 * time; // "stand" animation speed
if (my.skill21 > 100) {my.skill21 = 0;} // loop animation
}

ent_move(player_distance, nullvector);

if (key_j == 1) // if we press the left mouse button
{
my.skill22 = 0; // reset "attack" frames
while (my.skill22 < 100)
{
ent_vertex(my.sword_tip, 2698); // sword tip vertex coords - get the value in Med
ent_vertex(my.sword_base, 2698); // sword base vertex coords - get the value in Med
trace_mode = ignore_me + ignore_passable; // ignore me (the player) and all the entities that are passable
trace (my.sword_base, my.sword_tip); // trace between these sword positions
if (result != 0) // the player has hit something
{
effect (particle_sparks, 10, target, normal);
if (you != null) {you.healthpoints -= 5 * time;} // if it hasn't hit a wall, decrease health
ent_playsound (my, sword_snd, 50); // sword sound
}
ent_cycle("attack_a", my.skill22); // play attack frames animation
my.skill22 += 8 * time; // "attack" animation speed
wait (1);
}
while (key_j == 1) {wait (1);} // can't use autofire on a sword smile
}
wait (1);
}
while (my.skill23 < 90) // the player is dead
{
ent_cycle("knockdown", my.skill23); // play death frames animation
my.skill23 += 3 * time; // "death" animation speed
wait (1);
}
my.passable = on; // the corpse can't be hit by the enemy sword from now on
}
} 


und für die gravitation verwendest du am besten c_move

Last edited by Karotte; 09/13/08 16:57.