114 lines
82 KiB
C++
114 lines
82 KiB
C++
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$SP,"Mountain",BI=1$ //Used in $LK,"Camp",A="FI:::/Demo/Graphics/Camp.CPP"$, $LK,"Quail",A="FI:::/Apps/AfterEgypt/Quail.CPP"$, $LK,"GodTalking",A="FI:::/Apps/AfterEgypt/GodTalking.CPP"$, $LK,"Clouds",A="FI:::/Demo/MultiCore/Clouds.CPP"$, and $LK,"Squirt",A="FI:::/Demo/Games/Squirt.CPP"$.
|
|
|
|
|
|
|
|
|
|
|
|
$SP,"<2>",BI=2$ $SP,"<3>",BI=3$ $SP,"<4>",BI=4$
|
|
|
|
|
|
|
|
|
|
|
|
$SP,"<5>",BI=5$ $SP,"<6>",BI=6$ $SP,"<7>",BI=7$
|
|
|
|
U8 *right_imgs[4]={$IB,"<2>",BI=2$,$IB,"<3>",BI=3$,$IB,"<4>",BI=4$,$IB,"<3>",BI=3$},
|
|
*left_imgs [4]={$IB,"<5>",BI=5$,$IB,"<6>",BI=6$,$IB,"<5>",BI=5$,$IB,"<7>",BI=7$};
|
|
I64 x=0,y=0;
|
|
|
|
U0 DrawMountain(CTask *task,CDC *dc)
|
|
{
|
|
static I64 last_x;
|
|
static Bool last_left;
|
|
I64 cx=task->pix_width/2,cy=task->pix_height/2;
|
|
dc->color=BROWN;
|
|
dc->pen_width=2;
|
|
|
|
Sprite3(dc,0,117,0,$IB,"<1>",BI=1$);
|
|
GrLine3(dc,cx,cy,0,cx+100,cy-20,0);
|
|
GrLine3(dc,cx+100,cy-20,0,cx-90,cy-40,0);
|
|
GrLine3(dc,cx-90,cy-40,0,cx+70,cy-60,0);
|
|
GrLine3(dc,cx+70,cy-60,0,cx-70,cy-60,0);
|
|
GrLine3(dc,cx-70,cy-60,0,cx+60,cy-80,0);
|
|
GrLine3(dc,cx+60,cy-80,0,cx-50,cy-100,0);
|
|
GrLine3(dc,cx-50,cy-100,0,cx+30,cy-120,0);
|
|
GrLine3(dc,cx+30,cy-120,0,cx-15,cy-140,0);
|
|
|
|
dc->color=BROWN;
|
|
GrCircle(dc,50,25,15);
|
|
dc->color=YELLOW;
|
|
GrFloodFill(dc,50,25);
|
|
|
|
if (Blink) {
|
|
dc->color=BLACK;
|
|
GrPrint(dc,cx-50,80,"Mt. Horeb");
|
|
}
|
|
|
|
if (x<last_x)
|
|
last_left=TRUE;
|
|
else if (x>last_x)
|
|
last_left=FALSE;
|
|
dc->pen_width=1;
|
|
if (last_left)
|
|
Sprite3(dc,x+cx,y+cy,0,left_imgs [ToI64(6.0*tS)&3]);
|
|
else
|
|
Sprite3(dc,x+cx,y+cy,0,right_imgs[ToI64(6.0*tS)&3]);
|
|
last_x=x;
|
|
}
|
|
|
|
//This is the path of the man.
|
|
CD3I32 mountain[17]={{0,0,0},{100,-20,0},{100,-20,0},{-100,-40,0},{-100,-40,0},
|
|
{80,-60,0},{80,-60,0},{-80,-60,0},{-80,-60,0},
|
|
{60,-80,0},{60,-80,0},{-60,-100,0},{-60,-100,0},{40,-120,0},
|
|
{40,-120,0},{-37,-140,0},{-37,-140,0}};
|
|
|
|
Bool PlotMan(U8 *,I64 _x,I64 _y,I64)
|
|
{
|
|
x=_x; y=_y;
|
|
Sleep(10);
|
|
return !ToBool(ScanChar);
|
|
}
|
|
|
|
U0 Mountain()
|
|
{
|
|
SettingsPush(Fs,TSF_SAME_SONG); //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
|
try {
|
|
Fs->text_attr=YELLOW<<4+BLUE;
|
|
AutoComplete;
|
|
WinBorder;
|
|
WinMax;
|
|
DocCursor;
|
|
DocClear;
|
|
Fs->draw_it=&DrawMountain;
|
|
BSpline2(NULL,&mountain,17,&PlotMan); //See $LK,"Graphics/Math",A="HI:Graphics/Math"$.
|
|
} catch
|
|
PutExcept;
|
|
SettingsPop(Fs,TSF_SAME_SONG);
|
|
}
|
|
|
|
#if __CMD_LINE__
|
|
Mountain;
|
|
#endif
|
|
|