U0 AnimateTask(I64) { //Preemption is off after Spawn I64 i; F64 t; Obj *tempo; while (TRUE) { t=tS; for (i=0;itype==OT_SHEEP || tempo->type==OT_GOAT1 || tempo->type==OT_GOAT2) { tempo->x+=tempo->dx; tempo->y+=tempo->dy; tempo->z+=tempo->dz; tempo->dx=5*Cos(0.5*t+tempo->é); tempo->dz=5*Sin(0.5*t+tempo->é); } } Sleep(20); } } U0 Init() { Obj *tempo; I64 i,j,k,total=0; for (i=0;ix=RandU32&0x1FFF-0x1000; tempo->y=0; tempo->z=RandU32&0x1FFF-0x1000; tempo->é=2*ã*Rand; tempo->sym=RandU16&1; k=0; j=RandU32%total; while (TRUE) { j-=type_weights[k]; if (j<0) break; else k++; } tempo->type=k; } objs[O_BURNING_BUSH].type=OT_BUSH1; vx=0; vz=0; é=0; horeb_done=FALSE; } #define ANIMATE_STEPS 10 U0 AnimateéTask(F64 a) { I64 i; for (i=0;itext_attr=YELLOW<<4+BLUE; Fs->win_inhibit=WIG_TASK_DFT-WIF_FOCUS-WIF_GRAB_SCROLL-WIF_MENU; WordStat; WinMax; WinBorder; Preempt(OFF); DocClear; "$$BG,LTCYAN$$"; NewLine(6); "$$BG,YELLOW$$"; NewLine(30); BibleVerse(,"Exodus,3:1",21); Init; Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs); Fs->draw_it=&DrawHoreb; while (!horeb_done) { while (ScanKey(&ch,&sc)) switch (ch) { case 0: switch (sc.u8[0]) { case SC_CURSOR_LEFT: Spawn(&AnimateéTask,(-ã/100)(I64),"Animate é",,Fs); break; case SC_CURSOR_RIGHT: Spawn(&AnimateéTask,( ã/100)(I64),"Animate é",,Fs); break; case SC_CURSOR_UP: Spawn(&AnimateVTask,(-40.0 )(I64),"Animate V",,Fs); break; case SC_CURSOR_DOWN: Spawn(&AnimateVTask,( 40.0 )(I64),"Animate V",,Fs); break; } break; case '\n': Init; break; case CH_SHIFT_ESC: case CH_ESC: goto hr_done; } WinMgrSync; } hr_done: //Don't goto out of try } catch Fs->catch_except=TRUE; DocClear; SettingsPop(Fs,TSF_SAME_SONG); MenuPop; }