font st="bhoma",0,40;
text massage_txt{
layer=1;
pos_x=100;
pos_y=520;
font=st;
string="press <space> ";
flags=transparent;
}
//////////////////////
var tr_ev=off;
function check_tr(){
if(you==player){
tr_ev=on;
}
}
action key
{
my.shadow=on;
my.enable_trigger=on;
my.trigger_range=150;
my.event=check_tr;
while(1){
tr_ev=off;
my.pan = my.pan + 1;
wait (1);
}
}
action walk
{
player=my;
my.shadow=on;
move_mode=GLIDE;
//cam_control();
while(1)
{
////CAMERA////
vec_for_vertex(cam_temp,my,290);
vec_set(camera.x,cam_temp.x);
camera.pan=my.pan;
////////////////////////////
speed1+=5*time;
speed2+=1*time;
/////////////
if(key_cuu)
{
c_move(my,vector(10,0,0),nullvector,GLIDE+ACTIVATE _TRIGGER);
ent_animate(my,"walk",speed1,anm_cycle);
}
if(key_cud)
{
c_move(my,vector(-10,0,0),nullvector,GLIDE+ACTIVATE_TRIGGER);
ent_animate(my,"walk",speed1,anm_cycle);
}
if(key_cul)
{
c_move(my,vector(0,5,0),nullvector,GLIDE+ACTIVATE_ TRIGGER);
ent_animate(my,"walk",speed1,anm_cycle);
}
if(key_cur)
{
c_move(my,vector(0,-5,0),nullvector,GLIDE+ACTIVATE_TRIGGER);
ent_animate(my,"walk",speed1,anm_cycle);
}
if(key_w==off && key_s==off && key_a==off && key_d==off)
{
ent_animate(my,"stand",speed2,anm_cycle);
}else{
if(tr_ev)
{
massage_txt.alpha=0;
massage_txt.visible=on;
}else {
massage_txt.visible=off;
}
}
wait(1);
}
}
///////////
function main()
{
level_load (level_1_wmb);
}