2020-02-15 20:01:48 +00:00
|
|
|
|
//Press <CTRL-t>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
|
$SP,"",BI=1$
|
2020-02-15 20:01:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//The sprite was created with <CTRL-r>.
|
|
|
|
|
|
|
|
|
|
U0 ElephantWalk()
|
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
|
I64 sc,
|
2020-12-23 23:27:18 +00:00
|
|
|
|
x = Fs->pix_width >> 1, y = Fs->pix_height >> 1, //Fs is current $LK,"CTask",A="MN:CTask"$ struct.
|
|
|
|
|
x_last = x;
|
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
|
AutoComplete;
|
|
|
|
|
WinBorder;
|
|
|
|
|
WinMax;
|
|
|
|
|
DocClear;
|
2020-12-23 23:27:18 +00:00
|
|
|
|
while (TRUE)
|
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
|
DCFill;
|
2020-12-23 23:27:18 +00:00
|
|
|
|
if (x > x_last)
|
|
|
|
|
{
|
|
|
|
|
DCSymmetrySet(, x, y, x, y - 1);
|
|
|
|
|
gr.dc->flags |= DCF_SYMMETRY | DCF_JUST_MIRROR;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
gr.dc->flags &= ~(DCF_SYMMETRY | DCF_JUST_MIRROR);
|
|
|
|
|
x_last = x;
|
|
|
|
|
Sprite3ZB(gr.dc, x, y, 0, $IB,"<1>",BI=1$, Sin(8 * tS) / 4);//Use <CTRL-r> "Ptr to Sprite"
|
|
|
|
|
switch (KeyGet(&sc))
|
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
|
case 0:
|
2020-12-23 23:27:18 +00:00
|
|
|
|
switch (sc.u8[0])
|
|
|
|
|
{//Scan code $LK,"lowest byte",A="FI:::/Doc/CharOverview.DD"$
|
2020-02-20 23:40:10 +00:00
|
|
|
|
case SC_CURSOR_UP:
|
2020-12-23 23:27:18 +00:00
|
|
|
|
y -= 32;
|
|
|
|
|
if (y < 0)
|
|
|
|
|
y = Fs->pix_height;
|
2020-02-20 23:40:10 +00:00
|
|
|
|
break;
|
2020-12-23 23:27:18 +00:00
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
|
case SC_CURSOR_DOWN:
|
2020-12-23 23:27:18 +00:00
|
|
|
|
y += 32;
|
|
|
|
|
if (y > Fs->pix_height)
|
|
|
|
|
y = 0;
|
2020-02-20 23:40:10 +00:00
|
|
|
|
break;
|
2020-12-23 23:27:18 +00:00
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
|
case SC_CURSOR_LEFT:
|
2020-12-23 23:27:18 +00:00
|
|
|
|
x -= 32;
|
|
|
|
|
if (x < 0)
|
|
|
|
|
x = Fs->pix_width;
|
2020-02-20 23:40:10 +00:00
|
|
|
|
break;
|
2020-12-23 23:27:18 +00:00
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
|
case SC_CURSOR_RIGHT:
|
2020-12-23 23:27:18 +00:00
|
|
|
|
x += 32;
|
|
|
|
|
if (x > Fs->pix_width)
|
|
|
|
|
x = 0;
|
2020-02-20 23:40:10 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
2020-12-23 23:27:18 +00:00
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
|
case CH_ESC:
|
|
|
|
|
case CH_SHIFT_ESC:
|
|
|
|
|
goto ew_done;
|
|
|
|
|
}
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
ew_done:
|
2020-02-20 23:40:10 +00:00
|
|
|
|
DCFill;
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ElephantWalk;
|
|
|
|
|
|