///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <mtlFX.c>
///////////////////////////////
#define PRAGMA_PATH "C:\\Program Files\\GStudio7\\templates\\sounds";
SOUND* Sound1 = "explo.wav";
SOUND* Sound2 = "explosin.wav";
SOUND* Sound3 = "explosion.wav";
// do some silly movements ...
action AnimateFish()
{
var degree = 0;
var movePercent = 0;
while (1)
{
degree+=time_step*5;
movePercent += time_step*30;
me.x = 100*sin(degree);
me.y = 100*cos(degree);
me.pan = -degree;
ent_animate(me,"",movePercent,ANM_CYCLE);
wait(1);
}
}
function Sound()
{
while(1)
{
// Play after a key was released
if (key_1)
{
while (key_1) {wait(1);}
snd_play(Sound1,50,0);
}
// Play on key press and wait until the key is released
if (key_2)
{
snd_play(Sound2,50,0);
while (key_2) {wait(1);}
}
if (key_3)
{
snd_play(Sound3,50,0);
}
wait(1);
}
}
function main()
{
//video_screen = 1; // full screen
preload_mode = 3; // preload entities
level_load(NULL);
camera.x = -300;
camera.z = 100;
camera.tilt = -20;
ent_create("fisch1.mdl", vector(0,0,0), AnimateFish);
Sound();
}