43 lines
2.5 KiB
HolyC
Executable File
43 lines
2.5 KiB
HolyC
Executable File
|
||
|
||
$SP,"<1>",BI=1$
|
||
|
||
|
||
$SP,"<2>",BI=2$
|
||
|
||
U0 DrawIt(CTask *task,CDC *dc)
|
||
{
|
||
I64 x,y;
|
||
|
||
x=ms.pos.x-task->pix_left;
|
||
y=ms.pos.y-task->pix_top;
|
||
Sprite3(dc,x,y,0,$IB,"<1>",BI=1$);
|
||
|
||
x=task->pix_width>>1;
|
||
y=task->pix_height>>1;
|
||
|
||
dc->color=ROP_COLLISION;
|
||
dc->bkcolor=WHITE;
|
||
dc->collision_cnt=0;
|
||
Sprite3(dc,x,y,0,$IB,"<1>",BI=1$);
|
||
|
||
dc->color=ROP_EQU;
|
||
GrPrint(dc,0,(task->pix_height-FONT_HEIGHT)>>1,
|
||
"Collisions:%d",dc->collision_cnt);
|
||
|
||
if (!dc->collision_cnt)
|
||
Sprite3(dc,x,y,0,$IB,"<1>",BI=1$);
|
||
else
|
||
Sprite3(dc,x,y,0,$IB,"<2>",BI=2$);
|
||
}
|
||
|
||
U0 Collision()
|
||
{
|
||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||
Fs->draw_it=&DrawIt;
|
||
PressAKey;
|
||
SettingsPop;
|
||
}
|
||
|
||
Collision;
|
||
|