mit oder ohne aircontrol?
EDIT:
Wie auch immer

Hier mit:
Code:
action PlayerAct
{
var jump_force;
var move_var; //We're going to use this as our move vector (X,Y,Z)
var dist_to_ground;
camera.visible = off; //turns off the default camera
while(player != null) //while the player object exists
{
move_var.x = 0; //resets them all back to 0
move_var.y = 0; //if we don't do thist hen the variables will addup
move_var.z = 0; //making the player move faster and faster with no stopping
dist_to_ground=0;
m_camera.x = player.x - 300 * cos(player.pan); //this will update the cameras position
m_camera.y = player.y - 300 * sin(player.pan);
m_camera.z = player.z + 150;
m_camera.pan = player.pan;
m_camera.tilt = -20;
vec_set(temp,my.x); //copies the second vector to the first
if(jump_force<=0) //nicht beim springen
{
temp.z -= 8000; //lets make the trace point way way below us
trace_mode = ignore_me+ignore_sprites+ignore_models+use_box; //see manual
dist_to_ground = trace(my.x,temp);
if(dist_to_ground > 5) //if from my pos to temp is greater than 5
{ move_var.z -= 20; } //fall speed of 20 (higher number, faster falling speed)
if(dist_to_ground <= 0) //if from my pos to temp is less than or equal to 0
{ move_var.z += 2; } //not touching the floor but extremely close
}
else
{
temp.z += 8000;
trace_mode = ignore_me+ignore_sprites+ignore_models+use_box; //see manual
result = trace(my.x,temp);
if(dist_to_ground > 5) //if from my pos to temp is greater than 5
{
move_var.z=15*time; //spiel damit rum
jump_force-=50*time; //spiel damit rum
}
else
{
jump_force=0;
}
if(dist_to_ground <= 0) //if from my pos to temp is less than or equal to 0
{ move_var.z -= 2; } //not touching the floor but extremely close
}
//Animation Variables
my.skill91 += 5*time; //walking/running
my.skill92 += 2*time; //for standing still
if(my.skill91 >= 100) { my.skill91 = 0; }
if(my.skill92 >= 100) { my.skill92 = 0; }
if(key_cuu == on) //if we press the up arrow key
{
move_var.x = 4; //give the X parameter a value of 4
ent_animate(me,"walk",my.skill91,anm_cycle+anm_add); //walk animation
//entity, frame name, percent, mode : see manual
}
if(key_cud == on) //if we press the down arrow key
{
ent_animate(me,"walk",my.skill91,anm_cycle+anm_add); //walk animation
move_var.x = -4; //give the X parameter a value of 4
}
if(key_cul == on) //if we press the left arrow key
{
my.pan += 4; //add to the pan value
}
if(key_cur == on) //if we press the right arrow key
{
my.pan -= 4; //subtract the pan value
}
if(key_Space&&jump_force<=0&&dist_to_ground<6)
{
jump_force=200;
}
while(key_any == 0)
{
ent_animate(me,"stand",my.skill92,anm_cycle+anm_add);
wait(1);
}
ent_move(move_var,nullvector); //nullvector is a 'blank' vector
wait(1);
}
}
Grüße
Jannes