New engine features

Top  Previous  Next

snd_pause and snd_start can pause and resume the playback of a sound

 

var soundtrack_handle;

 

sound mysnd_wav = <mysound.wav>;

 

function music_startup()

{

       soundtrack_handle = snd_loop (mysnd_wav, 100, 0);

       while (1)

       {

               if (key_p) // press "P" to pause the sound

               {

                       while (key_p) {wait (1);}

                       snd_pause(soundtrack_handle);

               }

               if (key_r) // press "R" to resume the playback of the sound

               {

                       while (key_r) {wait (1);}

                       snd_start(soundtrack_handle);

               }

               wait (1);

       }

}

 

 

Med improvments

 

Med allows us to set a new horizontal and vertical number of vertices for terrains, thus increasing or reducing their resolution.

 

aum64_hot1

 

 

mouse_dir3d

 

Gives the direction vector from the camera to the mouse pointer into the 3D level, taking into account mouse_pos and the view parameters.

 

entity mygun_ent

{

       type = "mygun.mdl"; // weapon model

       x = 20;

       y = 0;

       z = 0;

       flags = VISIBLE;

}

 

function gun_folows_mouse_startup()

{

       while (1)

       {

               vec_to_angle(mygun_ent.pan, mouse_dir3d);

               wait(1);

       }

}