File size: 1,328 Bytes
806d4b5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
//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.
<1>/* Graphics Not Rendered in HTML */
<2>/* Graphics Not Rendered in HTML */
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,<1>);
else
Sprite3B(dc,12.0*dt%task->pix_width,20,0,<2>);
}
U0 Song()
{
SettingsPush; //See 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;
|