action player_walk()
{
var move_stat = 0;
var move_dir = 0;
while(1)
{
//wenn a gedrückt wird...
if(key_a)
{
//...dann wird die Entity nach links gedreht
my.pan=90+1*90;
//animation run wird ausgeführt
ent_animate(me, "run",move_stat,ANM_CYCLE);
move_stat+=0.5;
//entity bewegt sich auf der xAchse 2 nach links
//es scheint, als bewege sie sich
my.x-=2;
}
else
{
//wenn weder a noch d gedrückt wird, dann stellt
//sich die entity in richtung des Spielers
my.pan=45+1*45*5;
//animation stand wird ausgeführt
ent_animate(me, "stand", move_stat, ANM_CYCLE);
move_stat+=0.5;
}
if(key_d)
{
//wenn d gedrückt wird, dann dreht sich die
//Figur nach rechts
my.pan = -90+1*90;
//animation run wird wieder ausgeführt
ent_animate(me,"run", move_stat, ANM_CYCLE);
move_stat+=0.1;
//Entity bewegt sich auf der xAchse 2 nach rechts
my.x+=2;
}
if(key_space)
{
printf("asdf");
}
//Cameraposition
camera.x = 100+my.x;
camera.y = -2500;
camera.z = 700+my.z;
camera.pan = 90;
wait(1);
}
}