function playerAdvance()
{
c_move(me, move_vec, vector(0, 0, my.GRAVITY_VAR),
USE_POLYGON | IGNORE_PASSABLE | IGNORE_PUSH | GLIDE);
}
action player_function()
{
...
player = me;
my.push = 10;
...
my.eflags |= FAT | NARROW;
...
c_setminmax(me);
set(my, POLYGON);
...
while (player_health > 0)
{
...
playerAdvance();
...
wait(1);
}
...
}
action villain_action()
{
...
my.eflags |= FAT | NARROW;
...
villain = me;
...
my.push = 10;
set(my, POLYGON);
...
while (my.status != villain_dead)
{
...
wait(1);
}
...
}
void createVillain()
{
villain = ent_create("villain.mdl",
vector(-64,146,-111), villain_action );
...
c_setminmax(villain);
// set bounding box to individual values
vec_set(villain.min_x,vector(30,20,80));
vec_set(villain.max_x,vector(-20,-20,0));
}
function newGameButton()
{
...
level_load ("gameWorld.wmb");
...
hero = ent_create ( "player.mdl", vector(8,-606,-111),
player_function );
...
}