87 lines
3.4 KiB
Plaintext
87 lines
3.4 KiB
Plaintext
//has graphics
|
||
|
||
void EndTsk()
|
||
{
|
||
Sound(0);
|
||
Exit;
|
||
}
|
||
|
||
I8 x=0,y=20;
|
||
|
||
void AnimateTsk()
|
||
{
|
||
while (TRUE) {
|
||
x++;
|
||
if (x>Fs->parent_tss->win_pixel_right-
|
||
Fs->parent_tss->win_pixel_left)
|
||
x=0;
|
||
Sleep(25);
|
||
}
|
||
}
|
||
|
||
|
||
//$FG,2$When using flood-fill in a graphic$FG$
|
||
//$FG,2$element, you probably want to $FG$
|
||
//$FG,2$convert it to a bitmap using the$FG$
|
||
//$FG,2$feature in the $FG,4$CTRL-R$FG,2$ menu.$FG$
|
||
|
||
$BG,2$
|
||
$PI,"<1>",1$
|
||
|
||
|
||
|
||
$PI,"<2>",2$
|
||
|
||
$BG,15$
|
||
|
||
void DrawIt(TssStruct *tss)
|
||
{
|
||
I8 *r;
|
||
GrBitMap *base=GrAlias(grbase2,tss);
|
||
|
||
//$FG,2$The following draws the normal text.$FG$
|
||
LtfUpdateBothLtf(tss);
|
||
|
||
base->flags|=BMF_TRANSFORMATION;
|
||
Free(base->r,tss);
|
||
r=GrTheta(0.25*Sin(pi2*t),tss);
|
||
base->r=GrScaleMat(r,1.5+0.5*Sin(t),tss);
|
||
Free(r,tss);
|
||
base->x=x;
|
||
base->y=y;
|
||
base->z=0;
|
||
if (t%0.5>0.25)
|
||
GrElemsPlot(base,0,0,0,$IB,"<1>",1$);
|
||
else
|
||
GrElemsPlot(base,0,0,0,$IB,"<2>",2$);
|
||
|
||
GrDel(base);
|
||
}
|
||
|
||
void Song()
|
||
{
|
||
void *old_update=Fs->update_win;
|
||
TssStruct *tss=Spawn(&AnimateTsk,"Animator",Fs);
|
||
Fs->end_task_cb=&EndTsk;
|
||
music_tempo=3.5;
|
||
Fs->update_win=&DrawIt;
|
||
try {
|
||
while (!ScanKey) {
|
||
Play("3qG2G3DBsDCDCqRCG",
|
||
"$$CL$$$$BG,2$$$$CM-LE,5$$$$FG,YELLOW$$Baa, \0the \0grass \0is \0green.\r\n\0 \0 \0 \0 \0 \0 \0");
|
||
Play("G2G3DBsDCDCqRCG",
|
||
"This \0must \0be \0a \0dream.\r\n\0 \0 \0 \0 \0 \0 \0");
|
||
Play("EeGFqBBDA2eGGqR",
|
||
"Thanks, \0my \0 \0shep\0herd. \0You \0are \0good.\r\n\0 \0 \0");
|
||
Play("3EeGFqBBDA2eGGqR",
|
||
"Thanks, \0my \0 \0shep\0herd. \0You \0are \0good.\r\n\0 \0 \0");
|
||
}
|
||
} catch
|
||
Fs->catch_except=TRUE;
|
||
Fs->update_win=old_update;
|
||
Kill(tss);
|
||
Sound(0);
|
||
}
|
||
|
||
Song;
|
||
|