action coin()
{

set(my,PASSABLE);
while(me)
{
my.emask |= ENABLE_SCAN;
my.pan += 1*time_step;
if(you == player)
{
ent_remove(me);
}
wait(1);
}
}


action ball()
{
VECTOR ball_speed;
ENTITY* ball;
VECTOR offset;
var jumptimer = -1.5;
my.skill1=0;
player = me;
my.push = 15;
my.ambient = 100;
my.alpha = 100;
Kamera();
ph_setgravity (vector(0, 0, -1500)); // set the gravity
phent_settype (my, PH_RIGID, PH_SPHERE); // set the physics entity type
phent_setmass (my, 2, PH_SPHERE); // and its mass
phent_setfriction (my, 90); // set the friction
phent_setdamping (my, 20, 20); // set the damping
phent_setelasticity (my, 50, 20); // set the elasticity
while (1)
{
c_scan(my.x,my.pan,vector(360,360,100),IGNORE_ME);
ball_speed.x = 40 * (key_d - key_a); // move the ball using the cursor keys
ball_speed.y = 40 * (key_w - key_s); // 25 sets the x / y movement speeds
ball_speed.z = 0; // no need to move on the vertical axis
vec_rotate(ball_speed,vector(camera.pan,0,0)); //Die Zeile rotiert deinen Bewegungsvektor mit der Kamera
if (key_p)
{
freeze_mode = 1;
set(pause_pan,VISIBLE);
mouse_mode = 2;
}
if(key_space)
{
phent_addvelcentral(me,vector(0,0,1500*time_step));
wait(-1);
}
phent_addtorqueglobal (my, ball_speed); // add a torque (an angular force) to the ball
if(my.z<-850)
{
ent_remove(my);
game_load("level",1);
return;
}
wait (1);
}
}