function hit_bullet(){
if(event_type == EVENT_ENTITY){
my.skill1 = -1;
}
}
function shoot_bullet01(){
var life = 50;
my.emask |= ENABLE_ENTITY;
my.event = hit_bullet;
my.skill1 = 1;
wait(1);
c_setminmax(my);
while(my.skill1 > 0){
c_move(me, vector(0, -1000 * time_step, 0), nullvector, USE_POLYGON | IGNORE_YOU);
if(life <= 0){
my.skill1 = -1;
}
life -= 1 * time_step;
wait(1);
}
ent_remove(my);
}
void main()
{
level_load("");
vec_set(camera.x, vector(-301, 177, 13));
vec_set(camera.pan, vector(302, -2, 0));
ENTITY* testEnt = ent_create(CUBE_MDL, vector(0, -1000, 0), NULL);
vec_fill(testEnt.scale_x, 10);
wait(1);
c_setminmax(testEnt);
set(testEnt, POLYGON);
while(1){
ent_create(CUBE_MDL, nullvector, shoot_bullet01);
wait(-1);
}
}