#include <acknex.h>
#include <default.c>
ENTITY*player1;
function update_position_startup();
VECTOR object_pos;
PANEL* pnl_show_xyz = {
digits(20,20,5,*,1,player1_pos.x);
digits(20,40,5,*,1,player1_pos.y);
digits(20,60,5,*,1,player1_pos.z);
flags = SHOW;
layer = 1;
}
action act_player1();
{
player1 = me;
me.ambient = 10;
while(1)
{
if (key_z) {me.pan += 3*time_step;}
if (key_x) {me.pan -= 3*time_step;}
if (key_a){c_move (me,vector( 5,0,0),nullvector,GLIDE);}
if (key_s){c_move (me,vector( -5,0,0),nullvector,GLIDE);}
if (key_q){c_move (me,vector( 0,0,1),nullvector,GLIDE);}
if (key_e){c_move (me,vector( 0,0,-1),nullvector,GLIDE);}
if (key_c) {me.tilt += 3*time_step;}
if (key_v) {me.tilt -= 3*time_step;}
if (key_r) {me.roll -= 3*time_step;}
if (key_t) {me.roll += 3*time_step;}
wait(1);
}
}
function main()
{
level_load ("");
wait(2); // wait until the level is loaded
ent_create("player1.mdl", vector(500, 0, 0),act_player1);
}
function update_position_startup() {
while(!player1) { wait(1); }
while(player1) {
vec_set(object_pos,player1.x);
wait(1);
}
}