#include <default.c>
#include <acknex.h>
ENTITY* player_box;
var jump = 0;
function cam()
{
while (1)
{
camera.x = player_box.x - 100;
camera.z = 300;
camera.y = 0;
camera.tilt = -50;
wait (1);
}
}
function land()
{
if (event_type == EVENT_BLOCK)
{
jump = 0;
}
}
function shoot()
{
while (1)
{
if (key_space)
{
jump = 20;
while (1)
{
c_move (player_box, nullvector, vector(0, 0, jump*time_step), GLIDE);
jump = jump - 0.2;
if (event_type == EVENT_BLOCK){break;}
wait(1);
}
}
wait(1);
}
}
action player_move()
{
player_box = my;
c_setminmax(my);
my.emask |= ENABLE_BLOCK;
my.event = land;
cam();
shoot();
while (1)
{
c_move (my, nullvector, vector (1*time_step, 20*(key_a-key_d)*time_step, 0),GLIDE);
wait (1);
}
}
function main()
{
level_load ("level.wmb");
}