action guard_with_pointer() // Movementsystem
{
guard1 = my;
while (1)
{
ent_animate(my, NULL, 0, 0); // Animation reset
if (key_space && guard_life > 0) // Player jumps
{
jump_percentage = 0;
while(jump_percentage < 18) // Raise into air
{
c_move (my, vector(0, 0, jump_percentage *time_step), nullvector, GLIDE); // Raise for jump_percentage
ent_animate(my, "jump", jump_percentage, NULL);
jump_percentage += 3* time_step; // Increase jump_percentage
wait(1);
}
jump_percentage = 18;
while(jump_percentage > 0) // Fall from the air
{
c_move (my, vector(0, 0, -(jump_percentage *time_step)), nullvector, GLIDE); // Fall for jump_percentage
ent_animate(my, "jump", jump_percentage, NULL);
jump_percentage -= 3* time_step; // Degrease jump_percentage
wait(1);
}
}
wait (1);
}
}