function gegner_event()
{
switch (event_type)
{
case EVENT_BLOCK:
{
my.health -= 10;
blink();
vec_to_angle(my.pan, normal);
return;
}
case EVENT_IMPACT:
{
my.health -= you.schaden;
you.health -= my.schaden;
blink();
return;
}
}
}
function player_collisions() // this is player's event function
{
switch (event_type)
{
case EVENT_BLOCK:
{
my.health -= 10;
blink();
vec_to_angle(my.pan, normal);
return;
}
case EVENT_IMPACT:
{
my.health -= you.schaden;
you.health -= my.schaden;
blink();
return;
}
}
}
function remove_plaser()
{
wait (1);
ent_remove(my);
}
function remove_procket()
{
wait (1);
ent_create (explosion_pcx, my.x, asteroid_explodes); // create the explosion sprite
ent_remove(my);
}
function schusstreffer_event() // Event vom Asteroiden
{
switch (event_type)
{
case EVENT_BLOCK:
{
vec_to_angle(my.pan, bounce);
return;
}
case EVENT_IMPACT:
{
my.health -= you.schaden;
you.health -= my.schaden;
blink();
return;
}
}
}
function asteroid_destroy() // wenn health <= 0
{
vec_add(my.x, vector(0,0,5));
ent_create (explosion_pcx, my.x, asteroid_explodes); // create the explosion sprite
wait (-0.2);
ent_remove(my);
}