58 lines
5.5 KiB
HolyC
Executable File
58 lines
5.5 KiB
HolyC
Executable File
//9 has graphics
|
||
|
||
//When using flood-fill in a graphic
|
||
//element, you probably want to
|
||
//convert it to a bitmap using the
|
||
//feature in the <CTRL-r> menu.
|
||
|
||
$SP,"<1>",BI=1$
|
||
|
||
|
||
$SP,"<2>",BI=2$
|
||
|
||
|
||
F64 t0=Beat;
|
||
|
||
U0 DrawIt(CTask *task,CDC *dc)
|
||
{
|
||
F64 dt=Beat-t0;
|
||
dc->flags|=DCF_TRANSFORMATION;
|
||
Mat4x4RotZ(dc->r,0.25*Sin(2*dt));
|
||
Mat4x4Scale(dc->r,1.5+0.5*Sin(dt/3));
|
||
DCMat4x4Set(dc,dc->r);
|
||
if (ToI64(dt)&1)
|
||
Sprite3B(dc,12.0*dt%task->pix_width,20,0,$IB,"<1>",BI=1$);
|
||
else
|
||
Sprite3B(dc,12.0*dt%task->pix_width,20,0,$IB,"<2>",BI=2$);
|
||
}
|
||
|
||
U0 Song()
|
||
{
|
||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||
Fs->text_attr=GREEN<<4+YELLOW;
|
||
Fs->draw_it=&DrawIt;
|
||
Fs->task_end_cb=&SndTaskEndCB;
|
||
|
||
MusicSettingsRst;
|
||
music.tempo=3.5;
|
||
try {
|
||
while (!ScanKey) {
|
||
t0=Beat;
|
||
Play("5qG4G5D4B5sDCDCqRCG",
|
||
"$$CL$$$$BG,9$$\n\n$$BG,2$$$$CM-LE,3$$$$FG,14$$Baa,\0"
|
||
"the\0grass\0is\0green.\n\0\0\0\0\0\0\0");
|
||
Play("5G4G5D4B5sDCDCqRCG",
|
||
"This\0must\0be\0a\0dream.\n\0\0\0\0\0\0\0");
|
||
Play("5EeGF4qBB5D4AeGGqR",
|
||
"Thanks,\0my\0\0shep\0herd.\0You\0are\0good.\n\0\0\0");
|
||
Play("5EeGF4qBB5D4AeGGqR",
|
||
"Thanks,\0my\0\0shep\0herd.\0You\0are\0good.\n\0\0\0");
|
||
}
|
||
} catch
|
||
PutExcept;
|
||
SettingsPop;
|
||
}
|
||
|
||
Song;
|
||
|