2021-07-03 05:07:57 +01:00
<!DOCTYPE HTML>
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html;charset=US-ASCII" >
2021-12-11 11:10:58 +00:00
< meta name = "generator" content = "ZealOS V1.07" >
2021-07-03 05:07:57 +01:00
< style type = "text/css" >
2021-10-08 07:06:11 +01:00
body {background-color:#1f1f1f;}
.cF0{color:#e3e3e3;background-color:#1f1f1f;}
.cF1{color:#4f84a6;background-color:#1f1f1f;}
.cF2{color:#73a255;background-color:#1f1f1f;}
.cF3{color:#297582;background-color:#1f1f1f;}
.cF4{color:#b34f4b;background-color:#1f1f1f;}
.cF5{color:#8a52c3;background-color:#1f1f1f;}
.cF6{color:#b7822f;background-color:#1f1f1f;}
.cF7{color:#444444;background-color:#1f1f1f;}
.cF8{color:#6d6d6d;background-color:#1f1f1f;}
.cF9{color:#94bfde;background-color:#1f1f1f;}
.cFA{color:#a1ce97;background-color:#1f1f1f;}
.cFB{color:#6db4be;background-color:#1f1f1f;}
.cFC{color:#e88e88;background-color:#1f1f1f;}
.cFD{color:#ca94e8;background-color:#1f1f1f;}
.cFE{color:#d4b475;background-color:#1f1f1f;}
.cFF{color:#1f1f1f;background-color:#1f1f1f;}
2021-07-03 05:07:57 +01:00
< / style >
< / head >
< body >
2021-07-05 01:12:38 +01:00
< pre style = "font-family:monospace;font-size:12pt" >
2021-12-11 11:10:58 +00:00
< a name = "l1" > < / a > < span class = cF2 > //Uses < / span > < a href = "https://zeal-operating-system.github.io/ZealOS/Demo/Lectures/FixedPoint.ZC.html#l1" > < span class = cF4 > fixed-point< / span > < / a > < span class = cF2 > .< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l2" > < / a >
< a name = "l3" > < / a > < / span > < span class = cF5 > RegDefault< / span > < span class = cF0 > (< / span > < span class = cF6 > " ZealOS/CastleFrankenstein" < / span > < span class = cF0 > , < / span > < span class = cF6 > " F64 best_score=9999;\n" < / span > < span class = cF0 > );
< a name = "l4" > < / a > < / span > < span class = cF5 > RegExe< / span > < span class = cF0 > (< / span > < span class = cF6 > " ZealOS/CastleFrankenstein" < / span > < span class = cF0 > );
< a name = "l5" > < / a >
< a name = "l6" > < / a > < / span > < span class = cF2 > //Set snap to 4 and width to 4< / span > < span class = cF0 >
< a name = "l7" > < / a > < / span > < span class = cF2 > //if you edit this map.< / span > < span class = cF0 >
< a name = "l8" > < / a >
< a name = "l9" > < / a > < / span > < span class = cF2 > //Don't forget to change the< / span > < span class = cF0 >
< a name = "l10" > < / a > < / span > < span class = cF2 > //starting pos.< / span > < span class = cF0 >
< a name = "l11" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > MAN_START_X < / span > < span class = cFE > 0< / span > < span class = cF0 >
< a name = "l12" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > MAN_START_Y < / span > < span class = cFE > 4< / span > < span class = cF0 > .< / span > < span class = cFE > 5< / span > < span class = cF0 >
< a name = "l13" > < / a > < / span > < span class = cFA >
< a name = "l14" > < / a > < 1> /* Graphics Not Rendered in HTML */< / span > < span class = cF0 >
< a name = "l15" > < / a >
< a name = "l16" > < / a >
< a name = "l17" > < / a >
< a name = "l18" > < / a >
< a name = "l19" > < / a >
< a name = "l20" > < / a >
< a name = "l21" > < / a >
< a name = "l22" > < / a >
< a name = "l23" > < / a >
< a name = "l24" > < / a >
< a name = "l25" > < / a >
< a name = "l26" > < / a >
< a name = "l27" > < / a >
< a name = "l28" > < / a >
< a name = "l29" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > MONSTER_SCALE < / span > < span class = cFE > 2< / span > < span class = cF0 > .< / span > < span class = cFE > 0< / span > < span class = cF0 >
< a name = "l30" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l31" > < / a > < / span > < span class = cFA > < 2> /* Graphics Not Rendered in HTML */< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l32" > < / a >
< a name = "l33" > < / a >
< a name = "l34" > < / a >
< a name = "l35" > < / a >
< a name = "l36" > < / a >
< a name = "l37" > < / a >
< a name = "l38" > < / a >
< a name = "l39" > < / a >
< a name = "l40" > < / a >
< a name = "l41" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l42" > < / a > < / span > < span class = cFA > < 3> /* Graphics Not Rendered in HTML */< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l43" > < / a >
< a name = "l44" > < / a >
< a name = "l45" > < / a >
< a name = "l46" > < / a >
< a name = "l47" > < / a >
< a name = "l48" > < / a >
< a name = "l49" > < / a >
< a name = "l50" > < / a >
< a name = "l51" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l52" > < / a > < / span > < span class = cFA > < 4> /* Graphics Not Rendered in HTML */< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l53" > < / a >
< a name = "l54" > < / a >
< a name = "l55" > < / a >
< a name = "l56" > < / a >
< a name = "l57" > < / a >
< a name = "l58" > < / a >
< a name = "l59" > < / a >
< a name = "l60" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > PLANT_SCALE < / span > < span class = cFE > 2< / span > < span class = cF0 > .< / span > < span class = cFE > 0< / span > < span class = cF0 >
< a name = "l61" > < / a >
< a name = "l62" > < / a >
< a name = "l63" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l64" > < / a > < / span > < span class = cFA > < 5> /* Graphics Not Rendered in HTML */< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l65" > < / a >
< a name = "l66" > < / a >
< a name = "l67" > < / a >
< a name = "l68" > < / a >
< a name = "l69" > < / a >
< a name = "l70" > < / a >
< a name = "l71" > < / a >
< a name = "l72" > < / a >
< a name = "l73" > < / a >
< a name = "l74" > < / a >
< a name = "l75" > < / a >
< a name = "l76" > < / a >
< a name = "l77" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l78" > < / a > < / span > < span class = cFA > < 6> /* Graphics Not Rendered in HTML */< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l79" > < / a >
< a name = "l80" > < / a >
< a name = "l81" > < / a >
< a name = "l82" > < / a >
< a name = "l83" > < / a >
< a name = "l84" > < / a >
< a name = "l85" > < / a >
< a name = "l86" > < / a >
< a name = "l87" > < / a >
< a name = "l88" > < / a >
< a name = "l89" > < / a >
< a name = "l90" > < / a >
< a name = "l91" > < / a >
< a name = "l92" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l93" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > SCREEN_SCALE < / span > < span class = cFE > 512< / span > < span class = cF0 >
< a name = "l94" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > PLOT_GRID_WIDTH < / span > < span class = cFE > 24< / span > < span class = cF0 >
< a name = "l95" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > PLOT_GRID_HEIGHT < / span > < span class = cFE > 24< / span > < span class = cF0 >
< a name = "l96" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > MAN_HEIGHT < / span > < span class = cFE > 125< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l97" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l98" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > MAP_SCALE < / span > < span class = cFE > 4< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l99" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > map_width, map_height;
< a name = "l100" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > *map = < / span > < span class = cF3 > NULL< / span > < span class = cF0 > , *panels_processed_bitmap = < / span > < span class = cF3 > NULL< / span > < span class = cF0 > ;
< a name = "l101" > < / a >
< a name = "l102" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > man_xx, man_yy;
< a name = "l103" > < / a > < / span > < span class = cF1 > F64< / span > < span class = cF0 > man_theta;
< a name = "l104" > < / a >
< a name = "l105" > < / a > < / span > < span class = cF1 > F64< / span > < span class = cF0 > t0, tf;
< a name = "l106" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l107" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > MONSTERS_NUM < / span > < span class = cFE > 10< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l108" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > monsters_left;
< a name = "l109" > < / a > < / span > < span class = cF1 > class< / span > < span class = cF0 > Monster
< a name = "l110" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l111" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > x, y;
< a name = "l112" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > dead, pad[< / span > < span class = cFE > 7< / span > < span class = cF0 > ];
2021-07-03 05:07:57 +01:00
< a name = "l113" > < / a >
< a name = "l114" > < / a > } monsters[MONSTERS_NUM];
< a name = "l115" > < / a >
< a name = "l116" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > CFTransform(< / span > < span class = cF9 > CDC< / span > < span class = cF0 > *dc, < / span > < span class = cF9 > I64< / span > < span class = cF0 > *x, < / span > < span class = cF9 > I64< / span > < span class = cF0 > *y, < / span > < span class = cF9 > I64< / span > < span class = cF0 > *z)
< a name = "l117" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l118" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > zz;
2021-07-03 05:07:57 +01:00
< a name = "l119" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l120" > < / a > < / span > < span class = cF5 > Mat4x4MulXYZ< / span > < span class = cF0 > (dc-> r, x, y, z);
< a name = "l121" > < / a > zz = SCREEN_SCALE / < / span > < span class = cFE > 3< / span > < span class = cF0 > + *z;
< a name = "l122" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (zz < < / span > < span class = cFE > 1< / span > < span class = cF0 > )
< a name = "l123" > < / a > zz = < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l124" > < / a > *x = SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > * *x / zz;
< a name = "l125" > < / a > *y = SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > * (*y + MAN_HEIGHT) / zz;
< a name = "l126" > < / a > *x += dc-> x;
< a name = "l127" > < / a > *y += dc-> y;
< a name = "l128" > < / a > *z += dc-> z;
2021-07-03 05:07:57 +01:00
< a name = "l129" > < / a > }
< a name = "l130" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l131" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > LOS_SCALE < / span > < span class = cFE > 4< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l132" > < / a >
< a name = "l133" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > LOSPlot(< / span > < span class = cF1 > U8< / span > < span class = cF0 > *, < / span > < span class = cF9 > I64< / span > < span class = cF0 > x, < / span > < span class = cF9 > I64< / span > < span class = cF0 > y, < / span > < span class = cF9 > I64< / span > < span class = cF0 > )
< a name = "l134" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l135" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!map[< / span > < span class = cF7 > (< / span > < span class = cF0 > y / LOS_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > * map_width + < / span > < span class = cF7 > (< / span > < span class = cF0 > x / LOS_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > ])
< a name = "l136" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > ;
< a name = "l137" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l138" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l139" > < / a > }
< a name = "l140" > < / a >
< a name = "l141" > < / a > < / span > < span class = cF1 > Bool< / span > < span class = cF0 > LOS(< / span > < span class = cF9 > I64< / span > < span class = cF0 > x1, < / span > < span class = cF9 > I64< / span > < span class = cF0 > y1, < / span > < span class = cF9 > I64< / span > < span class = cF0 > x2, < / span > < span class = cF9 > I64< / span > < span class = cF0 > y2)
< a name = "l142" > < / a > {< / span > < span class = cF2 > //Line of sight< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l143" > < / a > < / span > < span class = cF1 > return< / span > < span class = cF0 > < / span > < span class = cF5 > Line< / span > < span class = cF0 > (< / span > < span class = cF3 > NULL< / span > < span class = cF0 > , x1 * LOS_SCALE / SCREEN_SCALE, y1 * LOS_SCALE / SCREEN_SCALE, < / span > < span class = cFE > 0< / span > < span class = cF0 > ,
< a name = "l144" > < / a > x2 * LOS_SCALE / SCREEN_SCALE, y2 * LOS_SCALE / SCREEN_SCALE, < / span > < span class = cFE > 0< / span > < span class = cF0 > , & LOSPlot);
2021-07-03 05:07:57 +01:00
< a name = "l145" > < / a > }
< a name = "l146" > < / a >
< a name = "l147" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > < / span > < span class = cF5 > DrawIt< / span > < span class = cF0 > (< / span > < span class = cF9 > CTask< / span > < span class = cF0 > *task, < / span > < span class = cF9 > CDC< / span > < span class = cF0 > *dc)
< a name = "l148" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l149" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i, j, *r1, *r2, *r3, *s2w, xx, yy, zz, x, y, x1, y1, z1, c, x1w, y1w, x1h, y1h, xh, yh, zh,
< a name = "l150" > < / a > cx = task-> pix_width / < / span > < span class = cFE > 2< / span > < span class = cF0 > ,
< a name = "l151" > < / a > cy = task-> pix_height / < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
< a name = "l152" > < / a > < / span > < span class = cF1 > U8< / span > < span class = cF0 > *tmps;
< a name = "l153" > < / a > < / span > < span class = cF1 > F64< / span > < span class = cF0 > tt;
< a name = "l154" > < / a > < / span > < span class = cF9 > CD3I32< / span > < span class = cF0 > poly[< / span > < span class = cFE > 4< / span > < span class = cF0 > ];
< a name = "l155" > < / a > Monster *tmpm;
2021-07-03 05:07:57 +01:00
< a name = "l156" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l157" > < / a > < / span > < span class = cF5 > DCDepthBufAlloc< / span > < span class = cF0 > (dc);
< a name = "l158" > < / a > < / span > < span class = cF5 > MemSet< / span > < span class = cF0 > (panels_processed_bitmap, < / span > < span class = cFE > 0< / span > < span class = cF0 > , < / span > < span class = cF7 > (< / span > < span class = cF0 > map_width * map_height + < / span > < span class = cFE > 7< / span > < span class = cF7 > )< / span > < span class = cF0 > > > < / span > < span class = cFE > 3< / span > < span class = cF0 > );
2021-07-03 05:07:57 +01:00
< a name = "l159" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l160" > < / a > < / span > < span class = cF2 > //World to screen< / span > < span class = cF0 >
< a name = "l161" > < / a > < / span > < span class = cF5 > Mat4x4RotZ< / span > < span class = cF0 > (dc-> r, man_theta + < / span > < span class = cF3 > pi< / span > < span class = cF0 > / < / span > < span class = cFE > 2< / span > < span class = cF0 > );
< a name = "l162" > < / a > < / span > < span class = cF5 > Mat4x4RotX< / span > < span class = cF0 > (dc-> r, < / span > < span class = cF3 > pi< / span > < span class = cF0 > / < / span > < span class = cFE > 2< / span > < span class = cF0 > );
< a name = "l163" > < / a > < / span > < span class = cF5 > DCMat4x4Set< / span > < span class = cF0 > (dc, dc-> r);
2021-07-03 05:07:57 +01:00
< a name = "l164" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l165" > < / a > xh = -man_xx / SCREEN_SCALE;
< a name = "l166" > < / a > yh = -man_yy / SCREEN_SCALE;
< a name = "l167" > < / a > zh = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l168" > < / a > < / span > < span class = cF5 > Mat4x4MulXYZ< / span > < span class = cF0 > (dc-> r, & xh, & yh, & zh);
< a name = "l169" > < / a > < / span > < span class = cF5 > Mat4x4TranslationEqu< / span > < span class = cF0 > (dc-> r, xh, yh, zh);
2021-07-03 05:07:57 +01:00
< a name = "l170" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l171" > < / a > < / span > < span class = cF2 > //Screen to world< / span > < span class = cF0 >
< a name = "l172" > < / a > s2w = < / span > < span class = cF5 > Mat4x4IdentNew< / span > < span class = cF0 > (task);
< a name = "l173" > < / a > < / span > < span class = cF5 > Mat4x4RotX< / span > < span class = cF0 > (s2w, -< / span > < span class = cF3 > pi< / span > < span class = cF0 > / < / span > < span class = cFE > 2< / span > < span class = cF0 > );
< a name = "l174" > < / a > < / span > < span class = cF5 > Mat4x4RotZ< / span > < span class = cF0 > (s2w, -man_theta - < / span > < span class = cF3 > pi< / span > < span class = cF0 > / < / span > < span class = cFE > 2< / span > < span class = cF0 > );
< a name = "l175" > < / a > xh = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l176" > < / a > yh = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l177" > < / a > zh = SCREEN_SCALE;
< a name = "l178" > < / a > < / span > < span class = cF5 > Mat4x4MulXYZ< / span > < span class = cF0 > (s2w, & xh, & yh, & zh);
2021-07-03 05:07:57 +01:00
< a name = "l179" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l180" > < / a > < / span > < span class = cF2 > //Rotate light source< / span > < span class = cF0 >
< a name = "l181" > < / a > xx = dc-> ls.x;
< a name = "l182" > < / a > yy = dc-> ls.y;
< a name = "l183" > < / a > zz = -dc-> ls.z;
< a name = "l184" > < / a > (*dc-> transform)(dc, & xx, & yy, & zz);
< a name = "l185" > < / a > dc-> ls.x = xx;
< a name = "l186" > < / a > dc-> ls.y = yy;
< a name = "l187" > < / a > dc-> ls.z = zz;
2021-07-03 05:07:57 +01:00
< a name = "l188" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l189" > < / a > dc-> flags |= < / span > < span class = cF3 > DCF_TRANSFORMATION< / span > < span class = cF0 > ;
< a name = "l190" > < / a > dc-> transform = & CFTransform;
< a name = "l191" > < / a > dc-> x = cx;
< a name = "l192" > < / a > dc-> y = cy;
< a name = "l193" > < / a > r1 = < / span > < span class = cF5 > Mat4x4IdentNew< / span > < span class = cF0 > (task);
< a name = "l194" > < / a > < / span > < span class = cF5 > Mat4x4RotX< / span > < span class = cF0 > (r1, -< / span > < span class = cF3 > pi< / span > < span class = cF0 > / < / span > < span class = cFE > 2< / span > < span class = cF0 > );
< a name = "l195" > < / a > < / span > < span class = cF5 > Mat4x4RotZ< / span > < span class = cF0 > (r1, < / span > < span class = cF5 > tS< / span > < span class = cF0 > );
< a name = "l196" > < / a > < / span > < span class = cF5 > Mat4x4Scale< / span > < span class = cF0 > (r1, MONSTER_SCALE);
2021-07-03 05:07:57 +01:00
< a name = "l197" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l198" > < / a > r2 = < / span > < span class = cF5 > Mat4x4IdentNew< / span > < span class = cF0 > (task);
< a name = "l199" > < / a > < / span > < span class = cF5 > Mat4x4Scale< / span > < span class = cF0 > (r2, MONSTER_SCALE);
2021-07-03 05:07:57 +01:00
< a name = "l200" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l201" > < / a > r3 = < / span > < span class = cF5 > Mat4x4IdentNew< / span > < span class = cF0 > (task);
< a name = "l202" > < / a > < / span > < span class = cF5 > Mat4x4RotX< / span > < span class = cF0 > (r3, -< / span > < span class = cF3 > pi< / span > < span class = cF0 > / < / span > < span class = cFE > 2< / span > < span class = cF0 > );
< a name = "l203" > < / a > < / span > < span class = cF5 > Mat4x4Scale< / span > < span class = cF0 > (r3, PLANT_SCALE);
2021-07-03 05:07:57 +01:00
< a name = "l204" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l205" > < / a > < / span > < span class = cF5 > Seed< / span > < span class = cF0 > (< / span > < span class = cFE > 1< / span > < span class = cF0 > );
< a name = "l206" > < / a > x1h = man_xx + yh * PLOT_GRID_WIDTH / < / span > < span class = cFE > 2< / span > < span class = cF0 > + xh * (PLOT_GRID_HEIGHT - < / span > < span class = cFE > 1< / span > < span class = cF0 > );
< a name = "l207" > < / a > y1h = man_yy - xh * PLOT_GRID_WIDTH / < / span > < span class = cFE > 2< / span > < span class = cF0 > + yh * (PLOT_GRID_HEIGHT - < / span > < span class = cFE > 1< / span > < span class = cF0 > );
< a name = "l208" > < / a > xh > > = < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l209" > < / a > yh > > = < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l210" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (j = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; j < PLOT_GRID_HEIGHT * < / span > < span class = cFE > 2< / span > < span class = cF0 > ; j++)
< a name = "l211" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l212" > < / a > x1w = x1h;
< a name = "l213" > < / a > y1w = y1h;
< a name = "l214" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; i < PLOT_GRID_WIDTH * < / span > < span class = cFE > 4< / span > < span class = cF0 > ; i++)
< a name = "l215" > < / a > {
< a name = "l216" > < / a > xx = x1w / SCREEN_SCALE;
< a name = "l217" > < / a > yy = y1w / SCREEN_SCALE;
< a name = "l218" > < / a > x = xx * SCREEN_SCALE - man_xx;
< a name = "l219" > < / a > y = yy * SCREEN_SCALE - man_yy;
< a name = "l220" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cFE > 1< / span > < span class = cF0 > < = xx < map_width - < / span > < span class = cFE > 1< / span > < span class = cF0 > & & < / span > < span class = cFE > 1< / span > < span class = cF0 > < = yy < map_height - < / span > < span class = cFE > 1< / span > < span class = cF0 > & & !< / span > < span class = cF5 > LBts< / span > < span class = cF7 > (< / span > < span class = cF0 > panels_processed_bitmap, yy * map_width + xx< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l221" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l222" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF7 > (< / span > < span class = cF0 > c = map[yy * map_width + xx]< / span > < span class = cF7 > )< / span > < span class = cF0 > & &
< a name = "l223" > < / a > LOS< / span > < span class = cF7 > (< / span > < span class = cF0 > xx * SCREEN_SCALE + SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > , yy * SCREEN_SCALE + SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > , man_xx, man_yy< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l224" > < / a > {
< a name = "l225" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (c == < / span > < span class = cF3 > YELLOW< / span > < span class = cF0 > )
< a name = "l226" > < / a > dc-> color = < / span > < span class = cF3 > DKGRAY< / span > < span class = cF0 > ;
< a name = "l227" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l228" > < / a > dc-> color = c;
< a name = "l229" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].x = x;
< a name = "l230" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].y = y;
< a name = "l231" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].z = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l232" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].x = x + SCREEN_SCALE;
< a name = "l233" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].y = y;
< a name = "l234" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].z = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l235" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].x = x + SCREEN_SCALE;
< a name = "l236" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].y = y + SCREEN_SCALE;
< a name = "l237" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].z = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l238" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].x = x;
< a name = "l239" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].y = y + SCREEN_SCALE;
< a name = "l240" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].z = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l241" > < / a > < / span > < span class = cF5 > GrFillPoly3< / span > < span class = cF0 > (dc, < / span > < span class = cFE > 4< / span > < span class = cF0 > , poly);
< a name = "l242" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (c == < / span > < span class = cF3 > GREEN< / span > < span class = cF0 > )
< a name = "l243" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l244" > < / a > x1 = x + SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
< a name = "l245" > < / a > y1 = y + SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
< a name = "l246" > < / a > z1 = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l247" > < / a > < / span > < span class = cF5 > DCTransform< / span > < span class = cF0 > (dc, & x1, & y1, & z1);
< a name = "l248" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (z1 > < / span > < span class = cFE > 0< / span > < span class = cF0 > )
< a name = "l249" > < / a > < / span > < span class = cF5 > Sprite3Mat4x4B< / span > < span class = cF0 > (dc, x + SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > , y + SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > , < / span > < span class = cFE > 0< / span > < span class = cF0 > , < / span > < span class = cFA > < 5> < / span > < span class = cF0 > , r3);
< a name = "l250" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l251" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 > < / span > < span class = cF1 > if< / span > < span class = cF0 > (c == < / span > < span class = cF3 > YELLOW< / span > < span class = cF0 > )
< a name = "l252" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l253" > < / a > x1 = x + SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
< a name = "l254" > < / a > y1 = y + SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
< a name = "l255" > < / a > z1 = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l256" > < / a > < / span > < span class = cF5 > DCTransform< / span > < span class = cF0 > (dc, & x1, & y1, & z1);
< a name = "l257" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (z1 > < / span > < span class = cFE > 0< / span > < span class = cF0 > )
< a name = "l258" > < / a > < / span > < span class = cF5 > Sprite3Mat4x4B< / span > < span class = cF0 > (dc, x + SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > , y + SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > , < / span > < span class = cFE > 0< / span > < span class = cF0 > , < / span > < span class = cFA > < 6> < / span > < span class = cF0 > , r3);
< a name = "l259" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l260" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l261" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!map[< / span > < span class = cF7 > (< / span > < span class = cF0 > yy + < / span > < span class = cFE > 1< / span > < span class = cF7 > )< / span > < span class = cF0 > * map_width + xx])
< a name = "l262" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l263" > < / a > dc-> color = < / span > < span class = cF3 > LTGRAY< / span > < span class = cF0 > ;
< a name = "l264" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].x = x;
< a name = "l265" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].y = y + SCREEN_SCALE;
< a name = "l266" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].z = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l267" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].x = x + SCREEN_SCALE;
< a name = "l268" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].y = y + SCREEN_SCALE;
< a name = "l269" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].z = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l270" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].x = x + SCREEN_SCALE;
< a name = "l271" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].y = y + SCREEN_SCALE;
< a name = "l272" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].z = SCREEN_SCALE;
< a name = "l273" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].x = x;
< a name = "l274" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].y = y + SCREEN_SCALE;
< a name = "l275" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].z = SCREEN_SCALE;
< a name = "l276" > < / a > < / span > < span class = cF5 > GrFillPoly3< / span > < span class = cF0 > (dc, < / span > < span class = cFE > 4< / span > < span class = cF0 > , poly);
< a name = "l277" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l278" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!map[yy * map_width + xx + < / span > < span class = cFE > 1< / span > < span class = cF0 > ])
< a name = "l279" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l280" > < / a > dc-> color = < / span > < span class = cF3 > WHITE< / span > < span class = cF0 > ;
< a name = "l281" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].x = x + SCREEN_SCALE;
< a name = "l282" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].y = y;
< a name = "l283" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].z = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l284" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].x = x + SCREEN_SCALE;
< a name = "l285" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].y = y + SCREEN_SCALE;
< a name = "l286" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].z = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l287" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].x = x + SCREEN_SCALE;
< a name = "l288" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].y = y + SCREEN_SCALE;
< a name = "l289" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].z = SCREEN_SCALE;
< a name = "l290" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].x = x + SCREEN_SCALE;
< a name = "l291" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].y = y;
< a name = "l292" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].z = SCREEN_SCALE;
< a name = "l293" > < / a > < / span > < span class = cF5 > GrFillPoly3< / span > < span class = cF0 > (dc, < / span > < span class = cFE > 4< / span > < span class = cF0 > , poly);
< a name = "l294" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l295" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!map[< / span > < span class = cF7 > (< / span > < span class = cF0 > yy - < / span > < span class = cFE > 1< / span > < span class = cF7 > )< / span > < span class = cF0 > * map_width + xx])
< a name = "l296" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l297" > < / a > dc-> color =< / span > < span class = cF3 > LTGRAY< / span > < span class = cF0 > ;
< a name = "l298" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].x = x;
< a name = "l299" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].y = y;
< a name = "l300" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].z = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l301" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].x = x + SCREEN_SCALE;
< a name = "l302" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].y = y;
< a name = "l303" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].z = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l304" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].x = x + SCREEN_SCALE;
< a name = "l305" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].y = y;
< a name = "l306" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].z = SCREEN_SCALE;
< a name = "l307" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].x = x;
< a name = "l308" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].y = y;
< a name = "l309" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].z = SCREEN_SCALE;
< a name = "l310" > < / a > < / span > < span class = cF5 > GrFillPoly3< / span > < span class = cF0 > (dc, < / span > < span class = cFE > 4< / span > < span class = cF0 > , poly);
< a name = "l311" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l312" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!map[yy * map_width + xx - < / span > < span class = cFE > 1< / span > < span class = cF0 > ])
< a name = "l313" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l314" > < / a > dc-> color =< / span > < span class = cF3 > WHITE< / span > < span class = cF0 > ;
< a name = "l315" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].x = x;
< a name = "l316" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].y = y;
< a name = "l317" > < / a > poly[< / span > < span class = cFE > 0< / span > < span class = cF0 > ].z = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l318" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].x = x;
< a name = "l319" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].y = y + SCREEN_SCALE;
< a name = "l320" > < / a > poly[< / span > < span class = cFE > 1< / span > < span class = cF0 > ].z = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l321" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].x = x;
< a name = "l322" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].y = y + SCREEN_SCALE;
< a name = "l323" > < / a > poly[< / span > < span class = cFE > 2< / span > < span class = cF0 > ].z = SCREEN_SCALE;
< a name = "l324" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].x = x;
< a name = "l325" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].y = y;
< a name = "l326" > < / a > poly[< / span > < span class = cFE > 3< / span > < span class = cF0 > ].z = SCREEN_SCALE;
< a name = "l327" > < / a > < / span > < span class = cF5 > GrFillPoly3< / span > < span class = cF0 > (dc, < / span > < span class = cFE > 4< / span > < span class = cF0 > , poly);
< a name = "l328" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l329" > < / a > }
< a name = "l330" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l331" > < / a > x1w -= yh;
< a name = "l332" > < / a > y1w += xh;
< a name = "l333" > < / a > }
< a name = "l334" > < / a > x1h -= xh;
< a name = "l335" > < / a > y1h -= yh;
< a name = "l336" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l337" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l338" > < / a > < / span > < span class = cF2 > //Draw Monsters< / span > < span class = cF0 >
< a name = "l339" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > , tmpm = monsters; i < MONSTERS_NUM; i++, tmpm++)
< a name = "l340" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l341" > < / a > x = tmpm-> x;
< a name = "l342" > < / a > y = tmpm-> y;
< a name = "l343" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (LOS< / span > < span class = cF7 > (< / span > < span class = cF0 > x, y, man_xx, man_yy< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l344" > < / a > {
< a name = "l345" > < / a > x -= man_xx;
< a name = "l346" > < / a > y -= man_yy;
< a name = "l347" > < / a > xx = x;
< a name = "l348" > < / a > yy = y;
< a name = "l349" > < / a > zz = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l350" > < / a > < / span > < span class = cF5 > DCTransform< / span > < span class = cF0 > (dc, & xx, & yy, & zz);
< a name = "l351" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (zz > < / span > < span class = cFE > 0< / span > < span class = cF0 > )
< a name = "l352" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l353" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (tmpm-> dead)
< a name = "l354" > < / a > < / span > < span class = cF5 > Sprite3Mat4x4B< / span > < span class = cF0 > (dc, x, y, < / span > < span class = cFE > 0< / span > < span class = cF0 > , < / span > < span class = cFA > < 2> < / span > < span class = cF0 > , r2);
< a name = "l355" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l356" > < / a > {
< a name = "l357" > < / a > tt = < / span > < span class = cF5 > Tri< / span > < span class = cF0 > (< / span > < span class = cF5 > tS< / span > < span class = cF0 > , < / span > < span class = cFE > 1< / span > < span class = cF0 > .< / span > < span class = cFE > 0< / span > < span class = cF0 > );
< a name = "l358" > < / a > tmps = < / span > < span class = cF5 > SpriteInterpolate< / span > < span class = cF0 > (tt, < / span > < span class = cFA > < 3> < / span > < span class = cF0 > , < / span > < span class = cFA > < 4> < / span > < span class = cF0 > );
< a name = "l359" > < / a > < / span > < span class = cF5 > Sprite3Mat4x4B< / span > < span class = cF0 > (dc, x, y, < / span > < span class = cFE > 0< / span > < span class = cF0 > , tmps, r1);
< a name = "l360" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (tmps);
< a name = "l361" > < / a > }
< a name = "l362" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l363" > < / a > }
< a name = "l364" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l365" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (r1);
< a name = "l366" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (r2);
< a name = "l367" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (r3);
2021-07-03 05:07:57 +01:00
< a name = "l368" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l369" > < / a > < / span > < span class = cF2 > //Draw Map heads-up display, scaled 2 pixs< / span > < span class = cF0 >
< a name = "l370" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (dc-> r);
< a name = "l371" > < / a > < / span > < span class = cF5 > DCMat4x4Set< / span > < span class = cF0 > (dc, < / span > < span class = cF5 > Mat4x4IdentNew< / span > < span class = cF7 > (< / span > < span class = cF0 > task< / span > < span class = cF7 > )< / span > < span class = cF0 > );
< a name = "l372" > < / a > dc-> x = task-> pix_width - < / span > < span class = cFE > 2< / span > < span class = cF0 > * map_width;
< a name = "l373" > < / a > dc-> y = task-> pix_height - < / span > < span class = cFE > 2< / span > < span class = cF0 > * map_height;
< a name = "l374" > < / a > dc-> z = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l375" > < / a > dc-> transform = & < / span > < span class = cF5 > DCTransform< / span > < span class = cF0 > ;
< a name = "l376" > < / a > dc-> thick = < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
< a name = "l377" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; i < map_height; i++)
< a name = "l378" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (j = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; j < map_width; j++)
< a name = "l379" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l380" > < / a > dc-> color = map[(map_height - < / span > < span class = cFE > 1< / span > < span class = cF0 > - i) * map_width + j];
< a name = "l381" > < / a > < / span > < span class = cF5 > GrPlot3< / span > < span class = cF0 > (dc, < / span > < span class = cFE > 2< / span > < span class = cF0 > * j, < / span > < span class = cFE > 2< / span > < span class = cF0 > * i, < / span > < span class = cFE > 0< / span > < span class = cF0 > );
< a name = "l382" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l383" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l384" > < / a > < / span > < span class = cF2 > //Draw Things on heads-up Map< / span > < span class = cF0 >
< a name = "l385" > < / a > dc-> color = < / span > < span class = cF3 > LTPURPLE< / span > < span class = cF0 > ;
< a name = "l386" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > , tmpm = monsters; i < MONSTERS_NUM; i++, tmpm++)
< a name = "l387" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!tmpm-> dead)
< a name = "l388" > < / a > < / span > < span class = cF5 > GrPlot3< / span > < span class = cF0 > (dc, < / span > < span class = cFE > 2< / span > < span class = cF0 > * < / span > < span class = cF7 > (< / span > < span class = cF0 > tmpm-> x / SCREEN_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > ,
< a name = "l389" > < / a > < / span > < span class = cFE > 2< / span > < span class = cF0 > * < / span > < span class = cF7 > (< / span > < span class = cF0 > map_height - < / span > < span class = cFE > 1< / span > < span class = cF0 > - tmpm-> y / SCREEN_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > , < / span > < span class = cFE > 0< / span > < span class = cF0 > );
< a name = "l390" > < / a > dc-> color = < / span > < span class = cF3 > LTCYAN< / span > < span class = cF0 > ;
< a name = "l391" > < / a > < / span > < span class = cF5 > GrPlot3< / span > < span class = cF0 > (dc, < / span > < span class = cFE > 2< / span > < span class = cF0 > * < / span > < span class = cF7 > (< / span > < span class = cF0 > man_xx / SCREEN_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > , < / span > < span class = cFE > 2< / span > < span class = cF0 > * < / span > < span class = cF7 > (< / span > < span class = cF0 > map_height - < / span > < span class = cFE > 1< / span > < span class = cF0 > - man_yy / SCREEN_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > , < / span > < span class = cFE > 0< / span > < span class = cF0 > );
2021-07-03 05:07:57 +01:00
< a name = "l392" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l393" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (tf)
< a name = "l394" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l395" > < / a > dc-> color = < / span > < span class = cF3 > LTRED< / span > < span class = cF0 > ;
< a name = "l396" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cF5 > Blink< / span > < span class = cF0 > )
< a name = "l397" > < / a > < / span > < span class = cF5 > GrPrint< / span > < span class = cF0 > (dc, cx - < / span > < span class = cF7 > (< / span > < span class = cF3 > FONT_WIDTH< / span > < span class = cF0 > * < / span > < span class = cFE > 14< / span > < span class = cF7 > )< / span > < span class = cF0 > / < / span > < span class = cFE > 2< / span > < span class = cF0 > , cy - < / span > < span class = cF3 > FONT_HEIGHT< / span > < span class = cF0 > / < / span > < span class = cFE > 2< / span > < span class = cF0 > , < / span > < span class = cF6 > " Game Completed" < / span > < span class = cF0 > );
< a name = "l398" > < / a > tt = tf;
< a name = "l399" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l400" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l401" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l402" > < / a > dc-> color = < / span > < span class = cF3 > LTGREEN< / span > < span class = cF0 > ;
< a name = "l403" > < / a > < / span > < span class = cF5 > GrLine< / span > < span class = cF0 > (dc, cx - < / span > < span class = cFE > 5< / span > < span class = cF0 > , cy, cx + < / span > < span class = cFE > 5< / span > < span class = cF0 > , cy);
< a name = "l404" > < / a > < / span > < span class = cF5 > GrLine< / span > < span class = cF0 > (dc, cx, cy - < / span > < span class = cFE > 5< / span > < span class = cF0 > , cx, cy + < / span > < span class = cFE > 5< / span > < span class = cF0 > );
< a name = "l405" > < / a > tt = < / span > < span class = cF5 > tS< / span > < span class = cF0 > ;
< a name = "l406" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l407" > < / a > < / span > < span class = cF5 > GrPrint< / span > < span class = cF0 > (dc, < / span > < span class = cFE > 0< / span > < span class = cF0 > , < / span > < span class = cFE > 0< / span > < span class = cF0 > , < / span > < span class = cF6 > " Enemy:%d Time:%3.2f Best:%3.2f" < / span > < span class = cF0 > , monsters_left, tt - t0, best_score);
< a name = "l408" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (s2w);
< a name = "l409" > < / a > < / span > < span class = cF5 > Seed< / span > < span class = cF0 > (< / span > < span class = cFE > 0< / span > < span class = cF0 > );
2021-07-03 05:07:57 +01:00
< a name = "l410" > < / a > }
< a name = "l411" > < / a >
< a name = "l412" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > Fire()
< a name = "l413" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l414" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i, x, y;
< a name = "l415" > < / a > < / span > < span class = cF1 > F64< / span > < span class = cF0 > d, dx, dy, xx = < / span > < span class = cF5 > Cos< / span > < span class = cF0 > (man_theta), yy = < / span > < span class = cF5 > Sin< / span > < span class = cF0 > (man_theta);
< a name = "l416" > < / a > Monster *tmpm;
2021-07-03 05:07:57 +01:00
< a name = "l417" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l418" > < / a > < / span > < span class = cF5 > Noise< / span > < span class = cF0 > (< / span > < span class = cFE > 100< / span > < span class = cF0 > , < / span > < span class = cFE > 53< / span > < span class = cF0 > , < / span > < span class = cFE > 74< / span > < span class = cF0 > );
< a name = "l419" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > , tmpm = monsters; i < MONSTERS_NUM; i++, tmpm++)
< a name = "l420" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l421" > < / a > x = tmpm-> x;
< a name = "l422" > < / a > y = tmpm-> y;
< a name = "l423" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!tmpm-> dead & & LOS< / span > < span class = cF7 > (< / span > < span class = cF0 > x, y, man_xx, man_yy< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l424" > < / a > {
< a name = "l425" > < / a > dx = x - man_xx;
< a name = "l426" > < / a > dy = man_yy - y;
< a name = "l427" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (d = < / span > < span class = cF5 > Sqrt< / span > < span class = cF7 > (< / span > < span class = cF0 > dx * dx + dy * dy< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l428" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l429" > < / a > dx /= d;
< a name = "l430" > < / a > dy /= d;
< a name = "l431" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (dx * xx + dy * yy > < / span > < span class = cFE > 0< / span > < span class = cF0 > .< / span > < span class = cFE > 995< / span > < span class = cF0 > )
< a name = "l432" > < / a > {
< a name = "l433" > < / a > tmpm-> dead = < / span > < span class = cF3 > TRUE< / span > < span class = cF0 > ;
< a name = "l434" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!--monsters_left)
< a name = "l435" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l436" > < / a > tf = < / span > < span class = cF5 > tS< / span > < span class = cF0 > ;
< a name = "l437" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (tf - t0 < best_score)
< a name = "l438" > < / a > best_score = tf - t0;
< a name = "l439" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l440" > < / a > }
< a name = "l441" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l442" > < / a > }
< a name = "l443" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l444" > < / a > }
< a name = "l445" > < / a >
< a name = "l446" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > Init()
< a name = "l447" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l448" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i, x, y;
< a name = "l449" > < / a > < / span > < span class = cF9 > CDC< / span > < span class = cF0 > *dc;
< a name = "l450" > < / a > Monster *tmpm;
2021-07-03 05:07:57 +01:00
< a name = "l451" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l452" > < / a > < / span > < span class = cF5 > DocClear< / span > < span class = cF0 > ;
< a name = "l453" > < / a > < / span > < span class = cF6 > " $BG,BLACK$%h*c" < / span > < span class = cF0 > , < / span > < span class = cF3 > TEXT_ROWS< / span > < span class = cF0 > / < / span > < span class = cFE > 2< / span > < span class = cF0 > , < / span > < span class = cF6 > '\n'< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l454" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l455" > < / a > dc = < / span > < span class = cF5 > Sprite2DC< / span > < span class = cF0 > (< / span > < span class = cFA > < 1> < / span > < span class = cF0 > );
< a name = "l456" > < / a > map_width = dc-> width / MAP_SCALE + < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
< a name = "l457" > < / a > map_height = dc-> height / MAP_SCALE + < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
< a name = "l458" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (map);
< a name = "l459" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (panels_processed_bitmap);
< a name = "l460" > < / a > map = < / span > < span class = cF5 > CAlloc< / span > < span class = cF0 > (map_width * map_height * < / span > < span class = cF1 > sizeof< / span > < span class = cF7 > (< / span > < span class = cF1 > U8< / span > < span class = cF7 > )< / span > < span class = cF0 > );
< a name = "l461" > < / a > panels_processed_bitmap = < / span > < span class = cF5 > MAlloc< / span > < span class = cF0 > (< / span > < span class = cF7 > (< / span > < span class = cF0 > map_width * map_height + < / span > < span class = cFE > 7< / span > < span class = cF7 > )< / span > < span class = cF0 > > > < / span > < span class = cFE > 3< / span > < span class = cF0 > );
< a name = "l462" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (y = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; y < map_height - < / span > < span class = cFE > 2< / span > < span class = cF0 > ; y++)
< a name = "l463" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (x = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; x < map_width - < / span > < span class = cFE > 2< / span > < span class = cF0 > ; x++)
< a name = "l464" > < / a > map[(map_height - < / span > < span class = cFE > 2< / span > < span class = cF0 > - y) * map_width + x + < / span > < span class = cFE > 1< / span > < span class = cF0 > ] = < / span > < span class = cF5 > GrPeek< / span > < span class = cF0 > (dc, x * MAP_SCALE, y * MAP_SCALE);
< a name = "l465" > < / a > < / span > < span class = cF5 > DCDel< / span > < span class = cF0 > (dc);
< a name = "l466" > < / a > man_xx = (< / span > < span class = cFE > 1< / span > < span class = cF0 > + MAN_START_X) * SCREEN_SCALE;
< a name = "l467" > < / a > man_yy = (map_height - < / span > < span class = cFE > 1< / span > < span class = cF0 > - MAN_START_Y) * SCREEN_SCALE;
< a name = "l468" > < / a > man_theta = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l469" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l470" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > , tmpm = monsters; i < MONSTERS_NUM; i++, tmpm++)
< a name = "l471" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l472" > < / a > tmpm-> dead = < / span > < span class = cF3 > FALSE< / span > < span class = cF0 > ;
< a name = "l473" > < / a > < / span > < span class = cF1 > do< / span > < span class = cF0 >
< a name = "l474" > < / a > {
< a name = "l475" > < / a > tmpm-> x = < / span > < span class = cF5 > RandU64< / span > < span class = cF0 > % (< / span > < span class = cF7 > (< / span > < span class = cF0 > map_width - < / span > < span class = cFE > 2< / span > < span class = cF7 > )< / span > < span class = cF0 > * SCREEN_SCALE) + SCREEN_SCALE;
< a name = "l476" > < / a > tmpm-> y = < / span > < span class = cF5 > RandU64< / span > < span class = cF0 > % (< / span > < span class = cF7 > (< / span > < span class = cF0 > map_height - < / span > < span class = cFE > 2< / span > < span class = cF7 > )< / span > < span class = cF0 > * SCREEN_SCALE) + SCREEN_SCALE;
< a name = "l477" > < / a > }
< a name = "l478" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (!map[< / span > < span class = cF7 > (< / span > < span class = cF0 > tmpm-> y / SCREEN_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > * map_width + tmpm-> x / SCREEN_SCALE]);
< a name = "l479" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l480" > < / a > monsters_left = MONSTERS_NUM;
< a name = "l481" > < / a > tf = < / span > < span class = cFE > 0< / span > < span class = cF0 > ;
< a name = "l482" > < / a > t0 = < / span > < span class = cF5 > tS< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l483" > < / a > }
< a name = "l484" > < / a >
< a name = "l485" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > AnimateTask(< / span > < span class = cF9 > I64< / span > < span class = cF0 > )
< a name = "l486" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l487" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i, x, y, dd;
< a name = "l488" > < / a > Monster *tmpm;
2021-07-03 05:07:57 +01:00
< a name = "l489" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l490" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (< / span > < span class = cF3 > TRUE< / span > < span class = cF0 > )
< a name = "l491" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l492" > < / a > dd = < / span > < span class = cFE > 0< / span > < span class = cF0 > .< / span > < span class = cFE > 25< / span > < span class = cF0 > * SCREEN_SCALE * < / span > < span class = cF5 > Sin< / span > < span class = cF0 > (< / span > < span class = cF5 > tS< / span > < span class = cF0 > / < / span > < span class = cFE > 2< / span > < span class = cF0 > );
< a name = "l493" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > , tmpm = monsters; i < MONSTERS_NUM; i++, tmpm++)
< a name = "l494" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!tmpm-> dead)
< a name = "l495" > < / a > {
< a name = "l496" > < / a > x = tmpm-> x;
< a name = "l497" > < / a > y = tmpm-> y;
< a name = "l498" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (i & < / span > < span class = cFE > 1< / span > < span class = cF0 > )
< a name = "l499" > < / a > x += dd;
< a name = "l500" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l501" > < / a > y += dd;
< a name = "l502" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (< / span > < span class = cFE > 0< / span > < span class = cF0 > < = x < = map_width * SCREEN_SCALE & &
< a name = "l503" > < / a > < / span > < span class = cFE > 0< / span > < span class = cF0 > < = y < = map_height * SCREEN_SCALE & &
< a name = "l504" > < / a > map[< / span > < span class = cF7 > (< / span > < span class = cF0 > y / SCREEN_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > * map_width + x / SCREEN_SCALE])
< a name = "l505" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l506" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!map[< / span > < span class = cF7 > (< / span > < span class = cF0 > y / SCREEN_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > * map_width + x / SCREEN_SCALE + < / span > < span class = cFE > 1< / span > < span class = cF0 > ] & &
< a name = "l507" > < / a > x - < / span > < span class = cF5 > RoundI64< / span > < span class = cF7 > (< / span > < span class = cF0 > x, SCREEN_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > > SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > ||
< a name = "l508" > < / a > !map[< / span > < span class = cF7 > (< / span > < span class = cF0 > y / SCREEN_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > * map_width + x / SCREEN_SCALE - < / span > < span class = cFE > 1< / span > < span class = cF0 > ] & &
< a name = "l509" > < / a > x - < / span > < span class = cF5 > RoundI64< / span > < span class = cF7 > (< / span > < span class = cF0 > x, SCREEN_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > < SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > )
< a name = "l510" > < / a > x = < / span > < span class = cF5 > RoundI64< / span > < span class = cF0 > (x, SCREEN_SCALE) + SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l511" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l512" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (!map[< / span > < span class = cF7 > (< / span > < span class = cF0 > y / SCREEN_SCALE + < / span > < span class = cFE > 1< / span > < span class = cF7 > )< / span > < span class = cF0 > * map_width + x / SCREEN_SCALE] & &
< a name = "l513" > < / a > y - < / span > < span class = cF5 > RoundI64< / span > < span class = cF7 > (< / span > < span class = cF0 > y, SCREEN_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > > SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > ||
< a name = "l514" > < / a > !map[< / span > < span class = cF7 > (< / span > < span class = cF0 > y / SCREEN_SCALE - < / span > < span class = cFE > 1< / span > < span class = cF7 > )< / span > < span class = cF0 > * map_width + x / SCREEN_SCALE] & &
< a name = "l515" > < / a > y - < / span > < span class = cF5 > RoundI64< / span > < span class = cF7 > (< / span > < span class = cF0 > y, SCREEN_SCALE< / span > < span class = cF7 > )< / span > < span class = cF0 > < SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > )
< a name = "l516" > < / a > y = < / span > < span class = cF5 > RoundI64< / span > < span class = cF0 > (y, SCREEN_SCALE) + SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
< a name = "l517" > < / a > tmpm-> x = x;
< a name = "l518" > < / a > tmpm-> y = y;
< a name = "l519" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l520" > < / a > }
< a name = "l521" > < / a > < / span > < span class = cF5 > Sleep< / span > < span class = cF0 > (< / span > < span class = cFE > 20< / span > < span class = cF0 > );
< a name = "l522" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l523" > < / a > }
< a name = "l524" > < / a >
< a name = "l525" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > CleanUp()
< a name = "l526" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l527" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (map);
< a name = "l528" > < / a > < / span > < span class = cF5 > Free< / span > < span class = cF0 > (panels_processed_bitmap);
< a name = "l529" > < / a > map = < / span > < span class = cF3 > NULL< / span > < span class = cF0 > ;
< a name = "l530" > < / a > panels_processed_bitmap = < / span > < span class = cF3 > NULL< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l531" > < / a > }
< a name = "l532" > < / a >
< a name = "l533" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > SongTask(< / span > < span class = cF9 > I64< / span > < span class = cF0 > )
< a name = "l534" > < / a > {< / span > < span class = cF2 > //Song by Terry A. Davis< / span > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l535" > < / a > < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> task_end_cb = & < / span > < span class = cF5 > SoundTaskEndCB< / span > < span class = cF0 > ;
< a name = "l536" > < / a > < / span > < span class = cF5 > MusicSettingsReset< / span > < span class = cF0 > ;
< a name = "l537" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (< / span > < span class = cF3 > TRUE< / span > < span class = cF0 > )
< a name = "l538" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l539" > < / a > < / span > < span class = cF5 > Play< / span > < span class = cF0 > (< / span > < span class = cF6 > " 3q.A#eGAeA#qAq.A#eGeAeA#qA" < / span > < span class = cF0 > );
< a name = "l540" > < / a > < / span > < span class = cF5 > Play< / span > < span class = cF0 > (< / span > < span class = cF6 > " 3q.A#eGA#AqGq.A#eGA#AqG" < / span > < span class = cF0 > );
< a name = "l541" > < / a > < / span > < span class = cF5 > Play< / span > < span class = cF0 > (< / span > < span class = cF6 > " 4eA#AqGeA#AqGeA#AGAA#AqG" < / span > < span class = cF0 > );
< a name = "l542" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l543" > < / a > }
< a name = "l544" > < / a >
< a name = "l545" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > MoveMan(< / span > < span class = cF1 > F64< / span > < span class = cF0 > theta)
< a name = "l546" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l547" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > x, y, color, step=SCREEN_SCALE / < / span > < span class = cFE > 2< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l548" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l549" > < / a > < / span > < span class = cF1 > do< / span > < span class = cF0 >
< a name = "l550" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l551" > < / a > x = man_xx + step * < / span > < span class = cF5 > Cos< / span > < span class = cF0 > (theta);
< a name = "l552" > < / a > y = man_yy - step * < / span > < span class = cF5 > Sin< / span > < span class = cF0 > (theta);
< a name = "l553" > < / a > x = < / span > < span class = cF5 > Clamp< / span > < span class = cF0 > (x, < / span > < span class = cFE > 0< / span > < span class = cF0 > , map_width * SCREEN_SCALE);
< a name = "l554" > < / a > y = < / span > < span class = cF5 > Clamp< / span > < span class = cF0 > (y, < / span > < span class = cFE > 0< / span > < span class = cF0 > , map_height * SCREEN_SCALE);
< a name = "l555" > < / a > color = map[y / SCREEN_SCALE * map_width + x / SCREEN_SCALE];
< a name = "l556" > < / a > < / span > < span class = cF1 > if< / span > < span class = cF0 > (color == < / span > < span class = cF3 > DKGRAY< / span > < span class = cF0 > || color == < / span > < span class = cF3 > GREEN< / span > < span class = cF0 > ) {
< a name = "l557" > < / a > man_xx = x;
< a name = "l558" > < / a > man_yy = y;
< a name = "l559" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l560" > < / a > }
< a name = "l561" > < / a > < / span > < span class = cF1 > else< / span > < span class = cF0 >
< a name = "l562" > < / a > step > > = < / span > < span class = cFE > 1< / span > < span class = cF0 > ;
< a name = "l563" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l564" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (step);
2021-07-03 05:07:57 +01:00
< a name = "l565" > < / a > }
< a name = "l566" > < / a >
< a name = "l567" > < / a > < / span > < span class = cF2 > //#define MICRO_STEPS < / span > < span class = cF0 > < / span > < span class = cF2 > 4< / span > < span class = cF0 >
< a name = "l568" > < / a > #< / span > < span class = cF1 > define< / span > < span class = cF0 > MICRO_STEPS < / span > < span class = cFE > 32< / span > < span class = cF0 >
< a name = "l569" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > RotateMan(< / span > < span class = cF1 > F64< / span > < span class = cF0 > d)
< a name = "l570" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l571" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > i;
2021-07-03 05:07:57 +01:00
< a name = "l572" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l573" > < / a > < / span > < span class = cF1 > for< / span > < span class = cF0 > (i = < / span > < span class = cFE > 0< / span > < span class = cF0 > ; i < MICRO_STEPS; i++)
< a name = "l574" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l575" > < / a > man_theta += d / MICRO_STEPS;
< a name = "l576" > < / a > < / span > < span class = cF2 > //< / span > < span class = cF0 > < / span > < span class = cF2 > Sleep(15);< / span > < span class = cF0 >
< a name = "l577" > < / a > < / span > < span class = cF5 > Sleep< / span > < span class = cF0 > (< / span > < span class = cFE > 1< / span > < span class = cF0 > );
< a name = "l578" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
2021-07-03 05:07:57 +01:00
< a name = "l579" > < / a > }
< a name = "l580" > < / a >
< a name = "l581" > < / a > < / span > < span class = cF1 > U0< / span > < span class = cF0 > CastleFrankenstein()
< a name = "l582" > < / a > {
2021-07-04 23:11:34 +01:00
< a name = "l583" > < / a > < / span > < span class = cF9 > I64< / span > < span class = cF0 > sc;
2021-07-03 05:07:57 +01:00
< a name = "l584" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l585" > < / a > < / span > < span class = cF5 > MenuPush< / span > < span class = cF0 > (
< a name = "l586" > < / a > < / span > < span class = cF6 > " File {" < / span > < span class = cF0 >
< a name = "l587" > < / a > < / span > < span class = cF6 > " Abort(,CH_SHIFT_ESC);" < / span > < span class = cF0 >
< a name = "l588" > < / a > < / span > < span class = cF6 > " Exit(,CH_ESC);" < / span > < span class = cF0 >
< a name = "l589" > < / a > < / span > < span class = cF6 > " }" < / span > < span class = cF0 >
< a name = "l590" > < / a > < / span > < span class = cF6 > " Play {" < / span > < span class = cF0 >
< a name = "l591" > < / a > < / span > < span class = cF6 > " Restart(,'\n');" < / span > < span class = cF0 >
< a name = "l592" > < / a > < / span > < span class = cF6 > " Fwd(,,SC_CURSOR_UP);" < / span > < span class = cF0 >
< a name = "l593" > < / a > < / span > < span class = cF6 > " Bwd(,,SC_CURSOR_DOWN);" < / span > < span class = cF0 >
< a name = "l594" > < / a > < / span > < span class = cF6 > " Left(,,SC_CURSOR_LEFT);" < / span > < span class = cF0 >
< a name = "l595" > < / a > < / span > < span class = cF6 > " Right(,,SC_CURSOR_RIGHT);" < / span > < span class = cF0 >
< a name = "l596" > < / a > < / span > < span class = cF6 > " Fire(,CH_SPACE);" < / span > < span class = cF0 >
< a name = "l597" > < / a > < / span > < span class = cF6 > " }" < / span > < span class = cF0 >
< a name = "l598" > < / a > );
2021-07-03 05:07:57 +01:00
< a name = "l599" > < / a >
2021-12-11 11:10:58 +00:00
< a name = "l600" > < / a > < / span > < span class = cF5 > SettingsPush< / span > < span class = cF0 > ; < / span > < span class = cF2 > //See < / span > < a href = "https://zeal-operating-system.github.io/ZealOS/System/TaskSettings.ZC.html#l3" > < span class = cF4 > SettingsPush< / span > < / a > < span class = cF0 >
2021-07-04 23:11:34 +01:00
< a name = "l601" > < / a > < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> text_attr = < / span > < span class = cF3 > DKGRAY< / span > < span class = cF0 > < < < / span > < span class = cFE > 4< / span > < span class = cF0 > + < / span > < span class = cF3 > WHITE< / span > < span class = cF0 > ;
< a name = "l602" > < / a > < / span > < span class = cF5 > AutoComplete< / span > < span class = cF0 > ;
< a name = "l603" > < / a > < / span > < span class = cF5 > WinBorder< / span > < span class = cF0 > ;
< a name = "l604" > < / a > < / span > < span class = cF5 > WinMax< / span > < span class = cF0 > ;
< a name = "l605" > < / a > < / span > < span class = cF5 > DocCursor< / span > < span class = cF0 > ;
< a name = "l606" > < / a > Init;
< a name = "l607" > < / a > < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> animate_task = < / span > < span class = cF5 > Spawn< / span > < span class = cF0 > (& AnimateTask, < / span > < span class = cF3 > NULL< / span > < span class = cF0 > , < / span > < span class = cF6 > " Animate" < / span > < span class = cF0 > ,, < / span > < span class = cF5 > Fs< / span > < span class = cF0 > );
< a name = "l608" > < / a > < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> song_task = < / span > < span class = cF5 > Spawn< / span > < span class = cF0 > (& SongTask, < / span > < span class = cF3 > NULL< / span > < span class = cF0 > , < / span > < span class = cF6 > " Song" < / span > < span class = cF0 > ,, < / span > < span class = cF5 > Fs< / span > < span class = cF0 > );
< a name = "l609" > < / a > < / span > < span class = cF5 > Fs< / span > < span class = cF0 > -> draw_it = & < / span > < span class = cF5 > DrawIt< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l610" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l611" > < / a > < / span > < span class = cF1 > try< / span > < span class = cF0 >
< a name = "l612" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l613" > < / a > < / span > < span class = cF1 > while< / span > < span class = cF0 > (< / span > < span class = cF3 > TRUE< / span > < span class = cF0 > )
< a name = "l614" > < / a > {
< a name = "l615" > < / a > < / span > < span class = cF1 > switch< / span > < span class = cF0 > (< / span > < span class = cF5 > KeyGet< / span > < span class = cF7 > (< / span > < span class = cF0 > & sc< / span > < span class = cF7 > )< / span > < span class = cF0 > )
< a name = "l616" > < / a > < / span > < span class = cF7 > {< / span > < span class = cF0 >
< a name = "l617" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > CH_SPACE< / span > < span class = cF0 > :
< a name = "l618" > < / a > Fire;
< a name = "l619" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l620" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l621" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF6 > '\n'< / span > < span class = cF0 > :
< a name = "l622" > < / a > Init;
< a name = "l623" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l624" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l625" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > CH_ESC< / span > < span class = cF0 > :
< a name = "l626" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > CH_SHIFT_ESC< / span > < span class = cF0 > :
< a name = "l627" > < / a > < / span > < span class = cF1 > goto< / span > < span class = cF0 > fs_done;
2021-07-03 05:07:57 +01:00
< a name = "l628" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l629" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cFE > 0< / span > < span class = cF0 > :
< a name = "l630" > < / a > < / span > < span class = cF1 > switch< / span > < span class = cF0 > (sc.u8[< / span > < span class = cFE > 0< / span > < span class = cF0 > ])
< a name = "l631" > < / a > {
< a name = "l632" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > SC_CURSOR_RIGHT< / span > < span class = cF0 > :
< a name = "l633" > < / a > < / span > < span class = cF2 > //< / span > < span class = cF0 > < / span > < span class = cF2 > Spawn(& RotateMan, (pi / 32)(I64));< / span > < span class = cF0 >
< a name = "l634" > < / a > RotateMan(< / span > < span class = cF3 > pi< / span > < span class = cF0 > / < / span > < span class = cFE > 32< / span > < span class = cF0 > );
< a name = "l635" > < / a > < / span > < span class = cF5 > FlushMessages< / span > < span class = cF0 > ;
< a name = "l636" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l637" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l638" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > SC_CURSOR_LEFT< / span > < span class = cF0 > :
< a name = "l639" > < / a > < / span > < span class = cF2 > //< / span > < span class = cF0 > < / span > < span class = cF2 > Spawn(& RotateMan, (-pi / 32)(I64));< / span > < span class = cF0 >
< a name = "l640" > < / a > RotateMan(-< / span > < span class = cF3 > pi< / span > < span class = cF0 > / < / span > < span class = cFE > 32< / span > < span class = cF0 > );
< a name = "l641" > < / a > < / span > < span class = cF5 > FlushMessages< / span > < span class = cF0 > ;
< a name = "l642" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l643" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l644" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > SC_CURSOR_UP< / span > < span class = cF0 > :
< a name = "l645" > < / a > MoveMan(man_theta);
< a name = "l646" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
2021-07-03 05:07:57 +01:00
< a name = "l647" > < / a >
2021-07-04 23:11:34 +01:00
< a name = "l648" > < / a > < / span > < span class = cF1 > case< / span > < span class = cF0 > < / span > < span class = cF3 > SC_CURSOR_DOWN< / span > < span class = cF0 > :
< a name = "l649" > < / a > MoveMan(man_theta + < / span > < span class = cF3 > pi< / span > < span class = cF0 > );
< a name = "l650" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l651" > < / a > }
< a name = "l652" > < / a > < / span > < span class = cF1 > break< / span > < span class = cF0 > ;
< a name = "l653" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l654" > < / a > }
2021-07-03 05:07:57 +01:00
< a name = "l655" > < / a > fs_done:
2021-07-04 23:11:34 +01:00
< a name = "l656" > < / a > < / span > < span class = cF7 > }< / span > < span class = cF0 >
< a name = "l657" > < / a > < / span > < span class = cF1 > catch< / span > < span class = cF0 >
< a name = "l658" > < / a > < / span > < span class = cF5 > PutExcept< / span > < span class = cF0 > ;
< a name = "l659" > < / a > < / span > < span class = cF5 > DocClear< / span > < span class = cF0 > ;
< a name = "l660" > < / a > < / span > < span class = cF5 > SettingsPop< / span > < span class = cF0 > ;
< a name = "l661" > < / a > CleanUp;
< a name = "l662" > < / a > < / span > < span class = cF5 > MenuPop< / span > < span class = cF0 > ;
< a name = "l663" > < / a > < / span > < span class = cF5 > RegWrite< / span > < span class = cF0 > (< / span > < span class = cF6 > " ZealOS/CastleFrankenstein" < / span > < span class = cF0 > , < / span > < span class = cF6 > " F64 best_score=%5.4f;\n" < / span > < span class = cF0 > , best_score);
2021-07-03 05:07:57 +01:00
< a name = "l664" > < / a > }
< a name = "l665" > < / a >
< a name = "l666" > < / a > CastleFrankenstein;
< / span > < / pre > < / body >
< / html >