TempleOSTS_130315.ISO
This commit is contained in:
1 parent
e57428affb
commit
17b71f1a2d
958 files changed
+26043
-15907
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,124 @@
|
||||
//Practice tracing circles
|
||||
|
||||
AcctRegSetDftEntry("TempleOS/CircleTrace","F64 best_score=999;\n");
|
||||
AcctRegExecuteBranch("TempleOS/CircleTrace");
|
||||
|
||||
I64 cx,cy;
|
||||
F64 avg_error=0,elapsed_time=0,total_error=0,score=999;
|
||||
|
||||
U0 SongTask(I64)
|
||||
{
|
||||
Fs->task_end_cb=&SndTaskEndCB;
|
||||
MusicSettingsRst;
|
||||
while (TRUE)
|
||||
Play("hEDCARCDECR");
|
||||
}
|
||||
|
||||
U0 DrawIt(CTask *task,CDC *)
|
||||
{
|
||||
U8 buf[128];
|
||||
SPrintF(buf,"Error:%6.3f Time:%6.3f Score:%6.3f Best:%8.3f",avg_error,elapsed_time,score,best_score);
|
||||
PlotWinStr(task,buf,BLACK<<4+WHITE,0,0);
|
||||
}
|
||||
|
||||
#define CIRCLE_RADIUS 100
|
||||
#define CIRCUMFERENCE (2*ã*CIRCLE_RADIUS)
|
||||
|
||||
Bool CTPlot(CDC *dc,I64 x,I64 y,I64)
|
||||
{
|
||||
F64 rad=Sqrt(Sqr(x-cx)+Sqr(y-cy));
|
||||
GrPlot(dc,x,y);
|
||||
total_error+=Abs(rad-CIRCLE_RADIUS);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
U0 CircleTrace()
|
||||
{
|
||||
I64 msg_code,p1,p2,x1,y1;
|
||||
F64 rad,t0,total_distance;
|
||||
CDC *dc=DCAlias;
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush","MN:SettingsPush"$
|
||||
Fs->song_task=Spawn(&SongTask,NULL,"Song",Fs);
|
||||
WordStat;
|
||||
|
||||
cx=Fs->win_pixel_width/2;
|
||||
cy=Fs->win_pixel_height/2;
|
||||
|
||||
Fs->win_inhibit=WIF_ALL-WIF_BORDER;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Fs->draw_it=&DrawIt;
|
||||
|
||||
DCFill;
|
||||
dc->color=ROP_XOR+BLACK^COLOR_TRANSPARENT;
|
||||
GrCircle(dc,cx,cy,CIRCLE_RADIUS);
|
||||
do {
|
||||
msg_code=GetMsg(&p1,&p2,
|
||||
1<<MSG_KEY_DOWN+1<<MSG_IP_L_DOWN);
|
||||
switch (msg_code) {
|
||||
case MSG_KEY_UP:
|
||||
break;
|
||||
case MSG_IP_L_DOWN:
|
||||
DCFill;
|
||||
dc->color=ROP_XOR+BLACK^COLOR_TRANSPARENT;
|
||||
GrCircle(dc,cx,cy,CIRCLE_RADIUS);
|
||||
dc->color=ROP_XOR+RED^COLOR_TRANSPARENT;
|
||||
t0=tT;
|
||||
total_distance=0.001;
|
||||
total_error=0;
|
||||
x1=p1; y1=p2;
|
||||
do {
|
||||
msg_code=ScanMsg(&p1,&p2,
|
||||
1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
switch (msg_code) {
|
||||
case MSG_IP_L_UP:
|
||||
break;
|
||||
case MSG_IP_MOVE:
|
||||
if (x1!=p1 || y1!=p2) {
|
||||
total_distance+=Sqrt(Sqr(x1-p1)+Sqr(y1-p2));
|
||||
Line(dc,x1,y1,0,p1,p2,0,&CTPlot);
|
||||
x1=p1;y1=p2;
|
||||
//undo overlapping pixels on segments
|
||||
GrPlot(dc,x1,y1);
|
||||
rad=Sqrt(Sqr(x1-cx)+Sqr(y1-cy));
|
||||
total_error-=Abs(rad-CIRCLE_RADIUS);
|
||||
}
|
||||
break;
|
||||
}
|
||||
elapsed_time=tT-t0;
|
||||
avg_error=total_error/total_distance;
|
||||
score=elapsed_time*avg_error;
|
||||
|
||||
//This $LK,"Sleep","MN:Sleep"$()s until the next time the
|
||||
//window mgr task runs. The
|
||||
//window mgr calls the UpdateWin() routine
|
||||
//and places msgs in the que, so there's
|
||||
//no need to do anything until the window mgr runs.
|
||||
WinMgrSync;
|
||||
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
music_mute=TRUE; Sleep(200);
|
||||
if (total_distance>0.95*CIRCUMFERENCE) {
|
||||
if (score<best_score) {
|
||||
Snd(2000);Sleep(50);Snd(0);Sleep(50);
|
||||
Snd(2000);Sleep(50);Snd(0);Sleep(50);
|
||||
Snd(2000);Sleep(50);
|
||||
best_score=score;
|
||||
} else {
|
||||
Snd(500);Sleep(50);
|
||||
}
|
||||
} else {
|
||||
Snd(100);Sleep(1000);
|
||||
}
|
||||
Snd(0); Sleep(200); music_mute=FALSE;
|
||||
break;
|
||||
}
|
||||
} while (msg_code!=MSG_KEY_DOWN || p1!=CH_SHIFT_ESC && p1!=CH_ESC);
|
||||
SettingsPop;
|
||||
DCFill;
|
||||
DCDel(dc);
|
||||
AcctRegWriteBranch("TempleOS/CircleTrace","F64 best_score=%5.4f;\n",best_score);
|
||||
}
|
||||
|
||||
CircleTrace; //Execute when #included
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,509 @@
|
||||
//Set snap to 4 and width to 4
|
||||
//if you edit this map.
|
||||
|
||||
//Don't forget to change the
|
||||
//starting pos.
|
||||
$BG,0$
|
||||
|
||||
$SP,"map",1$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"hero",2$
|
||||
|
||||
|
||||
|
||||
$SP,"hero_attack",3$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"template",4$ //This is a template you can copy and use to make a tile.
|
||||
//WHITE is the transparent color.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"tree",5$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"path",6$
|
||||
|
||||
|
||||
|
||||
$SP,"water1",7$
|
||||
|
||||
|
||||
|
||||
$SP,"water2",8$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"goblin",9$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"wall1",10$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"wall2",11$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$BG$
|
||||
|
||||
//These are indexed by color #.
|
||||
//See $LK,"COLORS","MN:RED"$.
|
||||
|
||||
U8 *tiles1[16]=
|
||||
{NULL,$IB,"<7>",7$ ,$IB,"<5>",5$ ,NULL,
|
||||
$IB,"<6>",6$ ,NULL,NULL,NULL,
|
||||
NULL,NULL,NULL,NULL,
|
||||
NULL,NULL,NULL,NULL};
|
||||
|
||||
U8 *tiles2[16]=
|
||||
{NULL,$IB,"<8>",8$ ,$IB,"<5>",5$ ,NULL,
|
||||
$IB,"<6>",6$ ,NULL,NULL,NULL,
|
||||
NULL,NULL,NULL,NULL,
|
||||
NULL,NULL,NULL,NULL};
|
||||
|
||||
|
||||
|
||||
#define SCREEN_SCALE 24
|
||||
#define SCREEN_WIDTH 24
|
||||
#define SCREEN_HEIGHT 24
|
||||
I64 screen_x,screen_y;
|
||||
|
||||
#define MAP_SCALE 4
|
||||
I64 map_width,map_height;
|
||||
U8 *map=NULL;
|
||||
|
||||
I64 man_x,man_y,man_dx,man_dy;
|
||||
Bool man_attack;
|
||||
F64 man_attack_t0;
|
||||
|
||||
#define NUM_MONSTERS 16
|
||||
class Monster
|
||||
{
|
||||
I64 x,y,dx,dy;
|
||||
Bool dead,pad[7];
|
||||
} monsters[NUM_MONSTERS];
|
||||
|
||||
#define LOS_SCALE 4
|
||||
|
||||
Bool LOSPlot(U8 *,I64 x,I64 y,I64)
|
||||
{
|
||||
if (!map[(y/LOS_SCALE)*map_width+(x/LOS_SCALE)])
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Bool LOS(I64 x1,I64 y1,I64 x2,I64 y2)
|
||||
{ //Line of sight
|
||||
return Line(NULL,x1*LOS_SCALE+LOS_SCALE/2,y1*LOS_SCALE+LOS_SCALE/2,0,
|
||||
x2*LOS_SCALE+LOS_SCALE/2,y2*LOS_SCALE+LOS_SCALE/2,0,&LOSPlot);
|
||||
}
|
||||
|
||||
U0 DrawIt(CTask *task,CDC *dc)
|
||||
{
|
||||
CDC *dc_t=DCAlias(gr_dc,task);
|
||||
I64 i,x,y,xx,yy,x1,y1,z1,color;
|
||||
CD3I32 poly[4];
|
||||
U8 **_tiles;
|
||||
|
||||
task->text_attr=BLACK<<4;
|
||||
if (Blink(5))
|
||||
_tiles=tiles1;
|
||||
else
|
||||
_tiles=tiles2;
|
||||
|
||||
GrRotXEqu(dc_t->r,60*2*ã/360);
|
||||
GrRotZEqu(dc_t->r,15*2*ã/360);
|
||||
GrSetRotMat(dc_t,dc_t->r);
|
||||
dc_t->x=task->win_pixel_width/2;
|
||||
dc_t->y=task->win_pixel_height/2;
|
||||
dc_t->flags|=DCF_TRANSFORMATION;
|
||||
|
||||
//You could make it much more efficient
|
||||
//if you did it like $LK-A,"::/TempleOS/Demo/GameStarters/BigGuns.CPP"$
|
||||
//with a $LK,"CDC","MN:CDC"$.
|
||||
|
||||
for (y=-SCREEN_HEIGHT/2;y<SCREEN_HEIGHT/2;y++) {
|
||||
yy=y+screen_y;
|
||||
if (0<=yy<map_height)
|
||||
for (x=-SCREEN_WIDTH/2;x<SCREEN_WIDTH/2;x++) {
|
||||
xx=x+screen_x;
|
||||
if (0<=xx<map_width) {
|
||||
if ((color=map[yy*map_width+xx]) &&
|
||||
LOS(xx,yy,man_x,man_y)) {
|
||||
if (_tiles[color]) {
|
||||
x1=x*SCREEN_SCALE;
|
||||
y1=y*SCREEN_SCALE;
|
||||
z1=0;
|
||||
GrTransform(dc_t,&x1,&y1,&z1);
|
||||
SpritePlot3(dc,x1,y1,z1,_tiles[color]);
|
||||
} else { //If no tile defined, do solid color.
|
||||
poly[0].x=x*SCREEN_SCALE;
|
||||
poly[0].y=y*SCREEN_SCALE;
|
||||
poly[0].z=0;
|
||||
poly[1].x=(x+1)*SCREEN_SCALE-1;
|
||||
poly[1].y=y*SCREEN_SCALE;
|
||||
poly[1].z=0;
|
||||
poly[2].x=(x+1)*SCREEN_SCALE;
|
||||
poly[2].y=(y+1)*SCREEN_SCALE-1;
|
||||
poly[2].z=0;
|
||||
poly[3].x=x*SCREEN_SCALE-1;
|
||||
poly[3].y=(y+1)*SCREEN_SCALE-1;
|
||||
poly[3].z=0;
|
||||
dc_t->color=color;
|
||||
GrFillPoly3(dc_t,4,poly);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dc_t->color=LTGRAY;
|
||||
for (x=-SCREEN_WIDTH/2;x<=SCREEN_WIDTH/2;x++)
|
||||
GrLine3(dc_t,x*SCREEN_SCALE,-SCREEN_HEIGHT/2*SCREEN_SCALE,0,x*SCREEN_SCALE,SCREEN_HEIGHT/2*SCREEN_SCALE-1,0);
|
||||
for (y=-SCREEN_HEIGHT/2;y<=SCREEN_HEIGHT/2;y++)
|
||||
GrLine3(dc_t,-SCREEN_WIDTH/2*SCREEN_SCALE,y*SCREEN_SCALE,0,SCREEN_WIDTH/2*SCREEN_SCALE,y*SCREEN_SCALE-1,0);
|
||||
|
||||
for (y=-SCREEN_HEIGHT/2;y<SCREEN_HEIGHT/2;y++) {
|
||||
yy=y+screen_y;
|
||||
if (0<=yy<map_height)
|
||||
for (x=-SCREEN_WIDTH/2;x<SCREEN_WIDTH/2;x++) {
|
||||
xx=x+screen_x;
|
||||
if (0<=xx<map_width) {
|
||||
if (!map[yy*map_width+xx]) {
|
||||
if (yy+1<map_height && LOS(xx,yy+1,man_x,man_y)) {
|
||||
x1=x*SCREEN_SCALE;
|
||||
y1=y*SCREEN_SCALE;
|
||||
z1=0;
|
||||
GrTransform(dc_t,&x1,&y1,&z1);
|
||||
SpritePlot3(dc,x1,y1,z1,$IB,"<10>",10$);
|
||||
}
|
||||
if (xx+1<map_width && LOS(xx+1,yy,man_x,man_y)) {
|
||||
x1=x*SCREEN_SCALE;
|
||||
y1=y*SCREEN_SCALE;
|
||||
z1=0;
|
||||
GrTransform(dc_t,&x1,&y1,&z1);
|
||||
SpritePlot3(dc,x1,y1,z1,$IB,"<11>",11$);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0;i<NUM_MONSTERS;i++)
|
||||
if (!monsters[i].dead && LOS(monsters[i].x,monsters[i].y,man_x,man_y)) {
|
||||
x1=(monsters[i].x-screen_x)*SCREEN_SCALE+SCREEN_SCALE/2;
|
||||
y1=(monsters[i].y-screen_y)*SCREEN_SCALE+SCREEN_SCALE/2;
|
||||
z1=0;
|
||||
GrTransform(dc_t,&x1,&y1,&z1);
|
||||
if (monsters[i].dx<0) {
|
||||
dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR;
|
||||
GrSetSymmetry(dc,x1,y1,x1,y1+1);
|
||||
} else
|
||||
dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR);
|
||||
SpritePlot3(dc,x1,y1,z1,$IB,"<9>",9$);
|
||||
}
|
||||
|
||||
x1=(man_x-screen_x)*SCREEN_SCALE+SCREEN_SCALE/2;
|
||||
y1=(man_y-screen_y)*SCREEN_SCALE+SCREEN_SCALE/2;
|
||||
z1=0;
|
||||
if (tT-man_attack_t0<0.2) {
|
||||
x1+=Tri(tT-man_attack_t0,0.2)*SCREEN_SCALE*man_dx;
|
||||
y1+=Tri(tT-man_attack_t0,0.2)*SCREEN_SCALE*man_dy;
|
||||
}
|
||||
GrTransform(dc_t,&x1,&y1,&z1);
|
||||
if (man_dx<0) {
|
||||
dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR;
|
||||
GrSetSymmetry(dc,x1,y1,x1,y1+1);
|
||||
} else
|
||||
dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR);
|
||||
|
||||
if (tT-man_attack_t0<0.2)
|
||||
SpritePlot3(dc,x1,y1,z1,$IB,"<3>",3$);
|
||||
else
|
||||
SpritePlot3(dc,x1,y1,z1,$IB,"<2>",2$);
|
||||
|
||||
DCDel(dc_t);
|
||||
}
|
||||
|
||||
|
||||
U0 Attack()
|
||||
{
|
||||
I64 i;
|
||||
man_attack_t0=tT;
|
||||
Noise(100,300,1000);
|
||||
for (i=0;i<NUM_MONSTERS;i++) {
|
||||
if (!monsters[i].dead &&
|
||||
man_x+man_dx==monsters[i].x && man_y+man_dy==monsters[i].y)
|
||||
monsters[i].dead=TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
U0 Init()
|
||||
{
|
||||
I64 i,x,y,minx,maxx,miny,maxy;
|
||||
CDC *dc;
|
||||
SpriteExtents($IB,"<1>",1$,&minx,&maxx,&miny,&maxy);
|
||||
map_width =(maxx-minx+1)/MAP_SCALE;
|
||||
map_height=(maxy-miny+1)/MAP_SCALE;
|
||||
Free(map);
|
||||
map=MAlloc(map_width*map_height*sizeof(U8));
|
||||
dc=DCNew(DCT_COLOR8,map_width*MAP_SCALE,map_height*MAP_SCALE);
|
||||
SpritePlot3(dc,-minx,-miny,0,$IB,"<1>",1$);
|
||||
for (y=0;y<map_height;y++)
|
||||
for (x=0;x<map_width;x++)
|
||||
map[y*map_width+x]=GrPeek(dc,x*MAP_SCALE,y*MAP_SCALE);
|
||||
DCDel(dc);
|
||||
|
||||
for (i=0;i<NUM_MONSTERS;i++) {
|
||||
monsters[i].dead=FALSE;
|
||||
monsters[i].dx=0;
|
||||
monsters[i].dy=0;
|
||||
do {
|
||||
monsters[i].x=RandU64%(map_width-2)+1;
|
||||
monsters[i].y=RandU64%(map_height-2)+1;
|
||||
} while (!map[(monsters[i].y)*map_width+monsters[i].x]);
|
||||
}
|
||||
man_attack_t0=tT;
|
||||
man_attack=FALSE;
|
||||
man_x=0;
|
||||
man_y=4;
|
||||
man_dx=0;
|
||||
man_dy=0;
|
||||
screen_x=0;
|
||||
screen_y=0;
|
||||
}
|
||||
|
||||
U0 CleanUp()
|
||||
{
|
||||
Free(map);
|
||||
map=NULL;
|
||||
}
|
||||
|
||||
U0 AnimateTask(I64)
|
||||
{
|
||||
I64 i,x,y,dx,dy;
|
||||
while (TRUE) {
|
||||
for (i=0;i<NUM_MONSTERS;i++)
|
||||
if (!monsters[i].dead) {
|
||||
dx=RandU16%3-1;
|
||||
dy=RandU16%3-1;
|
||||
x=monsters[i].x+dx;
|
||||
y=monsters[i].y+dy;
|
||||
if (0<=x<=map_width && 0<=y<=map_height &&
|
||||
map[y*map_width+x]) {
|
||||
monsters[i].x=x;
|
||||
monsters[i].y=y;
|
||||
monsters[i].dx=dx;
|
||||
monsters[i].dy=dy;
|
||||
}
|
||||
}
|
||||
Sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
U0 DunGen()
|
||||
{
|
||||
I64 ch,sc;
|
||||
|
||||
MenuPush(
|
||||
"File {"
|
||||
" Abort(,CH_SHIFT_ESC);"
|
||||
" Exit(,CH_ESC);"
|
||||
"}"
|
||||
"Play {"
|
||||
" Restart(,'\n');"
|
||||
" Up(,,SC_CURSOR_UP);"
|
||||
" Down(,,SC_CURSOR_DOWN);"
|
||||
" Left(,,SC_CURSOR_LEFT);"
|
||||
" Right(,,SC_CURSOR_RIGHT);"
|
||||
" Attack(,CH_SPACE);"
|
||||
"}"
|
||||
);
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush","MN:SettingsPush"$
|
||||
Preempt(OFF);
|
||||
WinMax;
|
||||
WordStat;
|
||||
Init;
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",Fs);
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Fs->draw_it=&DrawIt;
|
||||
|
||||
try {
|
||||
while (TRUE) {
|
||||
switch (GetMsg(&ch,&sc,1<<MSG_KEY_DOWN|1<<MSG_KEY_UP)) {
|
||||
case MSG_KEY_DOWN:
|
||||
switch (ch) {
|
||||
case '\n':
|
||||
Init;
|
||||
break;
|
||||
case CH_SPACE:
|
||||
man_attack=TRUE;
|
||||
break;
|
||||
case CH_ESC:
|
||||
case CH_SHIFT_ESC:
|
||||
goto dg_done;
|
||||
case 0:
|
||||
switch (sc.u8[0]) {
|
||||
case SC_CURSOR_RIGHT:
|
||||
if (man_attack) {
|
||||
man_dx=1;
|
||||
man_dy=0;
|
||||
Attack;
|
||||
} else
|
||||
if (man_x+1<map_width && map[man_y*map_width+(man_x+1)]==RED) {
|
||||
man_x++;
|
||||
if (man_x-screen_x>SCREEN_WIDTH/2-3) {
|
||||
screen_x+=SCREEN_WIDTH/2;
|
||||
if (screen_x+SCREEN_WIDTH/2>map_width)
|
||||
screen_x=map_width-SCREEN_WIDTH/2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SC_CURSOR_LEFT:
|
||||
if (man_attack) {
|
||||
man_dx=-1;
|
||||
man_dy=0;
|
||||
Attack;
|
||||
} else
|
||||
if (man_x-1>=0 && map[man_y*map_width+(man_x-1)]==RED) {
|
||||
man_x--;
|
||||
if (man_x-screen_x<-SCREEN_WIDTH/2+3) {
|
||||
screen_x-=SCREEN_WIDTH/2;
|
||||
if (screen_x-SCREEN_WIDTH/2<0)
|
||||
screen_x=SCREEN_WIDTH/2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SC_CURSOR_UP:
|
||||
if (man_attack) {
|
||||
man_dx=0;
|
||||
man_dy=-1;
|
||||
Attack;
|
||||
} else
|
||||
if (man_y-1>=0 && map[(man_y-1)*map_width+man_x]==RED) {
|
||||
man_y--;
|
||||
if (man_y-screen_y<-SCREEN_HEIGHT/2+3) {
|
||||
screen_y-=SCREEN_HEIGHT/2;
|
||||
if (screen_y-SCREEN_HEIGHT/2<0)
|
||||
screen_y=SCREEN_HEIGHT/2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SC_CURSOR_DOWN:
|
||||
if (man_attack) {
|
||||
man_dx=0;
|
||||
man_dy=1;
|
||||
Attack;
|
||||
} else
|
||||
if (man_y+1<map_height && map[(man_y+1)*map_width+man_x]==RED) {
|
||||
man_y++;
|
||||
if (man_y-screen_y>SCREEN_HEIGHT/2-3) {
|
||||
screen_y+=SCREEN_HEIGHT/2;
|
||||
if (screen_y+SCREEN_HEIGHT/2>map_height)
|
||||
screen_y=map_height-SCREEN_HEIGHT/2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MSG_KEY_UP:
|
||||
if (ch==CH_SPACE)
|
||||
man_attack=FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
dg_done:
|
||||
GetMsg(,,1<<MSG_KEY_UP);
|
||||
} catch
|
||||
CatchAll;
|
||||
SettingsPop;
|
||||
MenuPop;
|
||||
CleanUp;
|
||||
}
|
||||
|
||||
DunGen;
|
||||
| ||||