///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <mtlFX.c>
///////////////////////////////
#define _hit skill38
ENTITY* star_ent;
function star_event()
{
switch (event_type)
{
case EVENT_ENTITY:
beep();
my._hit = 1;
my.event = NULL;
return;
case EVENT_BLOCK:
beep();
my._hit = 1;
my.event = NULL;
return;
}
}
action star_fall()
{
my.emask |= IGNORE_PASSABLE | ENABLE_BLOCK | ENABLE_ENTITY ;
my.event = star_event;
while(me != NULL) {
if (my._hit == 1) {
break;
}
wait(1);
}
if (me != NULL) {
phent_enable(me, 0);
ent_remove(me);
}
}
function main()
{
level_load("Test.WMB");
wait(2);
star_ent = ent_create("star.mdl",vector(0,0,300),star_fall);
phent_settype(star_ent, PH_RIGID, PH_POLY);
phent_setgroup( star_ent, 1 );
phent_setmass(star_ent,0.1,PH_BOX);
phent_setdamping (star_ent, 15, 0 );
phent_enable( star_ent, 1 );
ph_setgravity(vector(0,0,-100));
ph_selectgroup( 1 );
}