147 lines
10 KiB
Plaintext
147 lines
10 KiB
Plaintext
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="generator" content="TempleOS V5.03">
|
||
|
<meta name="viewport" content="width=device-width">
|
||
|
<link rel="stylesheet" href="/style/templeos.css">
|
||
|
<script src="/script/templeos.js"></script>
|
||
|
<style type="text/css">
|
||
|
.cF0{color:#000000;background-color:#ffffff;}
|
||
|
.cF1{color:#0000aa;background-color:#ffffff;}
|
||
|
.cF2{color:#00aa00;background-color:#ffffff;}
|
||
|
.cF3{color:#00aaaa;background-color:#ffffff;}
|
||
|
.cF4{color:#aa0000;background-color:#ffffff;}
|
||
|
.cF5{color:#aa00aa;background-color:#ffffff;}
|
||
|
.cF6{color:#aa5500;background-color:#ffffff;}
|
||
|
.cF7{color:#aaaaaa;background-color:#ffffff;}
|
||
|
.cF8{color:#555555;background-color:#ffffff;}
|
||
|
.cF9{color:#5555ff;background-color:#ffffff;}
|
||
|
.cFA{color:#55ff55;background-color:#ffffff;}
|
||
|
.cFB{color:#55ffff;background-color:#ffffff;}
|
||
|
.cFC{color:#ff5555;background-color:#ffffff;}
|
||
|
.cFD{color:#ff55ff;background-color:#ffffff;}
|
||
|
.cFE{color:#ffff55;background-color:#ffffff;}
|
||
|
.cFF{color:#ffffff;background-color:#ffffff;}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<pre id="content">
|
||
|
<a name="l1"></a><span class=cF2>/* You "Adam include" this because you want the wallpaper</span><span class=cF0>
|
||
|
<a name="l2"></a></span><span class=cF2>routine to stay in mem even if this task is killed.</span><span class=cF0>
|
||
|
<a name="l3"></a>
|
||
|
<a name="l4"></a></span><span class=cF2> <CTRL-t> to see the hidden text needed for sprite elements.</span><span class=cF0>
|
||
|
<a name="l5"></a>
|
||
|
<a name="l6"></a></span><span class=cF2> <CTRL-r> to add a sprite to a document.</span><span class=cF0>
|
||
|
<a name="l7"></a></span><span class=cF2>*/</span><span class=cF0>
|
||
|
<a name="l8"></a></span><span class=cFA>
|
||
|
<a name="l9"></a><1>/* Graphics Not Rendered in HTML */</span><span class=cF0>
|
||
|
<a name="l10"></a>
|
||
|
<a name="l11"></a></span><span class=cFA>
|
||
|
<a name="l12"></a><2>/* Graphics Not Rendered in HTML */</span><span class=cF0>
|
||
|
<a name="l13"></a>
|
||
|
<a name="l14"></a></span><span class=cFA>
|
||
|
<a name="l15"></a><3>/* Graphics Not Rendered in HTML */</span><span class=cF0>
|
||
|
<a name="l16"></a>
|
||
|
<a name="l17"></a></span><span class=cFA>
|
||
|
<a name="l18"></a><4>/* Graphics Not Rendered in HTML */</span><span class=cF0>
|
||
|
<a name="l19"></a>
|
||
|
<a name="l20"></a>
|
||
|
<a name="l21"></a></span><span class=cFA>
|
||
|
<a name="l22"></a><5>/* Graphics Not Rendered in HTML */</span><span class=cF0>
|
||
|
<a name="l23"></a>
|
||
|
<a name="l24"></a>
|
||
|
<a name="l25"></a></span><span class=cFA>
|
||
|
<a name="l26"></a><6>/* Graphics Not Rendered in HTML */</span><span class=cF0>
|
||
|
<a name="l27"></a>
|
||
|
<a name="l28"></a>
|
||
|
<a name="l29"></a></span><span class=cFA>
|
||
|
<a name="l30"></a><7>/* Graphics Not Rendered in HTML */</span><span class=cF0>
|
||
|
<a name="l31"></a>
|
||
|
<a name="l32"></a></span><span class=cFA>
|
||
|
<a name="l33"></a><8>/* Graphics Not Rendered in HTML */</span><span class=cF0>
|
||
|
<a name="l34"></a>
|
||
|
<a name="l35"></a></span><span class=cFA>
|
||
|
<a name="l36"></a><9>/* Graphics Not Rendered in HTML */</span><span class=cF0>
|
||
|
<a name="l37"></a>
|
||
|
<a name="l38"></a>
|
||
|
<a name="l39"></a>#</span><span class=cF1>define</span><span class=cF0> TYPES_OF_CRITTERS 3
|
||
|
<a name="l40"></a>#</span><span class=cF1>define</span><span class=cF0> FRAMES_PER_CRITTER 4
|
||
|
<a name="l41"></a>
|
||
|
<a name="l42"></a></span><span class=cF1>U8</span><span class=cF0> *imgs[TYPES_OF_CRITTERS][FRAMES_PER_CRITTER]={
|
||
|
<a name="l43"></a> </span><span class=cF7>{</span><span class=cFA><1></span><span class=cF0>,</span><span class=cFA><2></span><span class=cF0>,</span><span class=cFA><3></span><span class=cF0>,</span><span class=cFA><2></span><span class=cF7>}</span><span class=cF0>,
|
||
|
<a name="l44"></a> </span><span class=cF7>{</span><span class=cFA><4></span><span class=cF0>,</span><span class=cFA><5></span><span class=cF0>,</span><span class=cFA><6></span><span class=cF0>,</span><span class=cFA><5></span><span class=cF7>}</span><span class=cF0>,
|
||
|
<a name="l45"></a> </span><span class=cF7>{</span><span class=cFA><7></span><span class=cF0>,</span><span class=cFA><8></span><span class=cF0>,</span><span class=cFA><9></span><span class=cF0>,</span><span class=cFA><8></span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l46"></a>};
|
||
|
<a name="l47"></a>
|
||
|
<a name="l48"></a>#</span><span class=cF1>define</span><span class=cF0> CRITTERS_NUM 16
|
||
|
<a name="l49"></a></span><span class=cF1>class</span><span class=cF0> Critter
|
||
|
<a name="l50"></a>{
|
||
|
<a name="l51"></a> </span><span class=cF9>I64</span><span class=cF0> x,y,dx,dy,type;
|
||
|
<a name="l52"></a> </span><span class=cF1>F64</span><span class=cF0> t_offset;
|
||
|
<a name="l53"></a>} wall_crits[CRITTERS_NUM];
|
||
|
<a name="l54"></a>
|
||
|
<a name="l55"></a></span><span class=cF1>U0</span><span class=cF0> (*old_wall_paper)(</span><span class=cF9>CTask</span><span class=cF0> *task);
|
||
|
<a name="l56"></a>
|
||
|
<a name="l57"></a></span><span class=cF1>U0</span><span class=cF0> WallPaperFish(</span><span class=cF9>CTask</span><span class=cF0> *task)
|
||
|
<a name="l58"></a>{
|
||
|
<a name="l59"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,x,y;
|
||
|
<a name="l60"></a> </span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cF5>DCAlias</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.dc2,task);
|
||
|
<a name="l61"></a> Critter *c=wall_crits;
|
||
|
<a name="l62"></a>
|
||
|
<a name="l63"></a> task->text_attr=</span><span class=cF3>CYAN</span><span class=cF0><<4+</span><span class=cF3>WHITE</span><span class=cF0>;
|
||
|
<a name="l64"></a> dc->color=</span><span class=cF3>BROWN</span><span class=cF0>;
|
||
|
<a name="l65"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<</span><span class=cF3>GR_HEIGHT</span><span class=cF0>;i+=20) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l66"></a> j=16*</span><span class=cF5>Tri</span><span class=cF0>(</span><span class=cF5>tS</span><span class=cF0>*10,20);
|
||
|
<a name="l67"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc,0,</span><span class=cF3>GR_HEIGHT</span><span class=cF0>-i-j,</span><span class=cF3>GR_HEIGHT</span><span class=cF0>-i-j,</span><span class=cF3>GR_HEIGHT</span><span class=cF0>);
|
||
|
<a name="l68"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l69"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<CRITTERS_NUM;i++,c++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l70"></a> j=(</span><span class=cF5>tS</span><span class=cF0>*4+c->t_offset)%FRAMES_PER_CRITTER;
|
||
|
<a name="l71"></a> x=c->x>>16%</span><span class=cF3>GR_WIDTH</span><span class=cF0>;
|
||
|
<a name="l72"></a> </span><span class=cF1>if</span><span class=cF0> (x<0) x+=</span><span class=cF3>GR_WIDTH</span><span class=cF0>;
|
||
|
<a name="l73"></a> y=c->y>>16%</span><span class=cF3>GR_HEIGHT</span><span class=cF0>;
|
||
|
<a name="l74"></a> </span><span class=cF1>if</span><span class=cF0> (y<0) y+=</span><span class=cF3>GR_HEIGHT</span><span class=cF0>;
|
||
|
<a name="l75"></a> </span><span class=cF1>if</span><span class=cF0> (c->dx<0) {
|
||
|
<a name="l76"></a> dc->flags|=</span><span class=cF3>DCF_SYMMETRY</span><span class=cF0>|</span><span class=cF3>DCF_JUST_MIRROR</span><span class=cF0>;
|
||
|
<a name="l77"></a> </span><span class=cF5>DCSymmetrySet</span><span class=cF0>(dc,x,y-1,x,y+1);
|
||
|
<a name="l78"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l79"></a> dc->flags&=~(</span><span class=cF3>DCF_SYMMETRY</span><span class=cF0>|</span><span class=cF3>DCF_JUST_MIRROR</span><span class=cF0>);
|
||
|
<a name="l80"></a> </span><span class=cF5>Sprite3</span><span class=cF0>(dc,x,y,0,imgs[c->type][j]);
|
||
|
<a name="l81"></a> c->x+=c->dx; c->y+=c->dy;
|
||
|
<a name="l82"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l83"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc);
|
||
|
<a name="l84"></a>
|
||
|
<a name="l85"></a> </span><span class=cF2>//Uncomment the following if you wish.</span><span class=cF0>
|
||
|
<a name="l86"></a> </span><span class=cF2>//old_wall_paper(task);</span><span class=cF0>
|
||
|
<a name="l87"></a>}
|
||
|
<a name="l88"></a>
|
||
|
<a name="l89"></a></span><span class=cF1>U0</span><span class=cF0> WallInit()
|
||
|
<a name="l90"></a>{
|
||
|
<a name="l91"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
||
|
<a name="l92"></a> Critter *c;
|
||
|
<a name="l93"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Fs</span><span class=cF0>!=</span><span class=cFB>adam_task</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l94"></a> </span><span class=cF6>"Must be Adam Included with SHIFT-F5.\n"</span><span class=cF0>
|
||
|
<a name="l95"></a> </span><span class=cF6>"(Would crash when code mem was freed.)\n"</span><span class=cF0>;
|
||
|
<a name="l96"></a> </span><span class=cF1>return</span><span class=cF0>;
|
||
|
<a name="l97"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l98"></a> old_wall_paper=</span><span class=cFB>gr</span><span class=cF0>.fp_wall_paper;
|
||
|
<a name="l99"></a> c=wall_crits;
|
||
|
<a name="l100"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<CRITTERS_NUM;i++,c++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l101"></a> c->x=(</span><span class=cF5>RandU16</span><span class=cF0>%</span><span class=cF3>GR_WIDTH</span><span class=cF0>)<<16;
|
||
|
<a name="l102"></a> c->y=(</span><span class=cF5>RandU16</span><span class=cF0>%</span><span class=cF3>GR_HEIGHT</span><span class=cF0>)<<16;
|
||
|
<a name="l103"></a> c->type=</span><span class=cF5>RandU16</span><span class=cF0>%TYPES_OF_CRITTERS;
|
||
|
<a name="l104"></a> c->dx=</span><span class=cF5>RandI16</span><span class=cF0>;
|
||
|
<a name="l105"></a> </span><span class=cF1>if</span><span class=cF0> (c->dx<0)
|
||
|
<a name="l106"></a> c->dx-=0x4000;
|
||
|
<a name="l107"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l108"></a> c->dx+=0x4000;
|
||
|
<a name="l109"></a> c->dy=</span><span class=cF5>RandI16</span><span class=cF0>;
|
||
|
<a name="l110"></a> c->t_offset=</span><span class=cF5>Rand</span><span class=cF0>*FRAMES_PER_CRITTER;
|
||
|
<a name="l111"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l112"></a> </span><span class=cFB>gr</span><span class=cF0>.fp_wall_paper=&WallPaperFish;
|
||
|
<a name="l113"></a>}
|
||
|
<a name="l114"></a>
|
||
|
<a name="l115"></a>WallInit;
|
||
|
</span></pre></body>
|
||
|
</html>
|