This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ENEMIES.PAS
executable file
·800 lines (701 loc) · 20.4 KB
/
ENEMIES.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
(*
** Enemies.PAS
**
** unit used by ASCSCRAM.PAS (ASCII-Scramble)
**
** updated: 9-Oct-94
** created: 8-Sep-94
*)
unit Enemies;
(**********************************************************)
(**) (**)
(**) INTERFACE (**)
(**) (**)
(**********************************************************)
uses
Global, GameObjs, Display;
const
BulletSpeed : array[1..LevelNum] of speedType = (3,2,1,1);
CometSpeed : array[1..LevelNum] of speedType = (6,4,2,1);
UfoSpeed : array[1..LevelNum] of speedType = (8,7,6,5);
UfMvSpeed : array[1..LevelNum] of speedType = (2,2,1,1);
UfShSpeed : array[1..LevelNum] of speedType = (15,10,7,6);
SeekerSpeed : array[1..LevelNum] of speedType = (6,5,4,3);
SeMvSpeed : array[1..LevelNum] of speedType = (3,2,1,1);
FighterSpeed: array[1..LevelNum] of speedType = (6,5,4,3);
FiMvSpeed : array[1..LevelNum] of speedType = (4,3,2,1);
FiShSpeed : array[1..LevelNum] of speedType = (20,16,12,10);
RobotSpeed : array[1..LevelNum] of speedType = (8,7,6,5);
RoMvSpeed : array[1..LevelNum] of speedType = (20,15,11,7);
RoShSpeed : array[1..LevelNum] of speedType = (20,16,12,10);
MaxEnemyShoot = 3;
NoShoot = 99;
type
ShootRec = record
dx, dy: PosType;
end;
ShootArr = array[1..MaxEnemyShoot] of ShootRec;
const
FighterShoot: ShootArr = ( (dx:0;dy:-2), (dx:-1;dy:0), (dx:0;dy:2) );
RobotShoot : ShootArr = ( (dx:-2;dy:-2), (dx:-3;dy:0), (dx:-2;dy:2) );
UfoShoot : ShootArr = ( (dx:NoShoot;dy:0), (dx:-2;dy:0), (dx:NoShoot;dy:0) );
type
EnemyPtr = ^EnemyObj;
EnemyObj = object( GameObj )
GetPoints : byte; (* points to score when killed *)
constructor Init( nx, ny: PosType; st: byte; points: byte; hits: byte );
destructor Done; virtual;
procedure MoveIt; virtual;
procedure HitIt( hits: byte ); virtual;
end;
EnemyBulletPtr = ^EnemyBulletObj;
EnemyBulletObj = object( GameObj )
constructor Init( nx, ny: PosType );
procedure MoveIt; virtual;
end;
extdEnemyPtr = ^extdEnemyObj;
extdEnemyObj = object( EnemyObj )
MoveSpeed : speedType; (* speed to adjust pos. to player *)
MoveCtr : speedType;
ShootPos : ShootArr; (* delta pos. of bullets *)
ShootSpeed : speedType; (* speed to shoot again *)
ShootCtr : speedType;
GetAdjustX : boolean; (* flag: true=adjust pos. in X/Y-dir.*)
GetAdjustY : boolean;
constructor Init( nx, ny: PosType; st: byte; points: byte; hits: byte;
mvSp: speedType; shSp: speedType );
destructor Done; virtual;
procedure SetShoot( sa: ShootArr );
(*$IFDEF hugo*)
procedure SetMoveSpeed( ms: speedType );
procedure SetShootSpeed ( ss: speedType );
(*$ENDIF*)
procedure MoveIt; virtual;
procedure EnableAdjustX; (* adjust pos. to player *)
procedure EnableAdjustY;
end;
BasePtr = ^BaseObj;
BaseObj = object( EnemyObj )
constructor Init(ny: PosType);
procedure HitIt( hits: byte ); virtual;
end;
CometPtr = ^CometObj;
CometObj = object ( EnemyObj )
constructor Init( ny: PosType );
procedure MoveIt; virtual;
procedure CheckXYRange; virtual;
end;
UfoPtr = ^UfoObj;
UfoObj = object ( extdEnemyObj )
constructor Init( ny: PosType );
procedure MoveIt; virtual;
procedure CheckXYRange; virtual;
end;
SeekerPtr = ^SeekerObj;
SeekerObj = object ( EnemyObj )
MoveSpeed: speedType;
MoveCtr : speedtype;
AdjustX: boolean;
constructor Init( nx, ny: PosType );
procedure MoveIt; virtual;
end;
SeekerDownPtr = ^SeekerDownObj;
SeekerDownObj = object ( SeekerObj )
constructor Init( nx, ny: PosType );
end;
SeekerUpPtr = ^SeekerUpObj;
SeekerUpObj = object ( SeekerObj )
constructor Init( nx, ny: PosType );
end;
FighterPtr = ^FighterObj;
FighterObj = object ( extdEnemyObj )
constructor Init;
destructor Done; virtual;
procedure MoveIt; virtual;
procedure CheckXYRange; virtual;
end;
RobotPtr = ^RobotObj;
RobotObj = object ( extdEnemyObj )
HeadDy : PosType; (* rel. pos to default head pos. *)
HeadMoveDir: byte; (* direction of head movement: 0=down, 1=up *)
HeadMoveCtr: PosType;
constructor Init;
destructor Done; virtual;
procedure MoveIt; virtual;
procedure CheckXYRange; virtual;
end;
const
RobotX = 5;
RobotHeadSizeX = 6; (* robot sizes *)
RobotHeadSizeY = 6;
RobotSizeX = 9;
RobotSizeY = 12;
RobotNeck = '````'+RobotNeckCh1+RobotNeckCh2+RobotNeckCh3+' `';
RobotStr: array[1..RobotSizeY] of string =
( RobotNeck,
RobotNeck, (* '`' stands for: skip char *)
RobotNeck,
RobotNeck,
RobotNeck,
'<\__/O\ `',
'< ___/I `',
'</ `[=] `',
'```/__] `',
'```H `H `',
'```H `H `',
'``<O><O> ' );
var
RobotTopY: PosType;
Robot : RobotPtr;
(**********************************************************)
(**) (**)
(**) IMPLEMENTATION (**)
(**) (**)
(**********************************************************)
uses Crt,
Player;
const
SeekerUp = 1; (* seeker types *)
SeekerDown = 2;
HeadMoveDown = 0; (* robot head move directions *)
HeadMoveUp = 1;
HeadMoveWait = 2;
function sc: PosType;
begin
if ScrollStatus then
sc := ScrollSpeed[Difficulty]
else
sc := SeekerSpeed[Difficulty];
end;
(*
**-------------------------------------
** MakeBigEnemy
**-------------------------------------
*)
procedure MakeBigEnemy( var list: GOList; mainObj: EnemyPtr;
sx, sy: byte; mx, my: byte; bs: string );
var
i, j: byte;
idx : byte;
subObj : GameObjPtr;
begin
for i := 1 to sx do
for j := 1 to sy do begin
idx := 1+(i-1)+sx*(j-1);
if ( (bs[idx] <> '`') (* dummy object *)
and ( (i<>mx) or (j<>my) )
)
then begin (* sub object *)
subObj := New( GameObjPtr,
Init( i-mx, j-my, flying ) );
with subObj^ do begin
SetParent( mainObj );
SetDisplay( bs[idx], ColorStd );
end;
list.Append( subObj );
end;
end;
end;
(*
**-------------------------------------
** methods for EnemyObj
**-------------------------------------
*)
constructor EnemyObj.Init( nx, ny: PosType; st: byte; points: byte; hits: byte );
begin
GameObj.Init( nx, ny, st );
GetPoints := points;
SetHits( hits );
end;
destructor EnemyObj.Done;
var
extra: GameObjPtr;
begin
GameObj.Done;
if status = killMe then begin (* enemie got killed? *)
Score := Score + GetPoints; (* Y-> incr. score *)
UpdateInfo := UpdateInfo or UpdScore;
if Score >= LifeScore then begin (* get extra life? *)
if ShipsLeft < 10 then (* Y-> incr. lifes *)
inc( ShipsLeft );
case LifeScore of (* calc next LifeScore *)
100: LifeScore := 250;
250: LifeScore := 500;
else
inc( LifeScore, 500 );
end;
UpdateInfo := UpdateInfo or UpdLife;
end;
if ExtraRatioCtr = 0 then begin (* create extra *)
ExtraRatioCtr := ExtraRatio;
extra := New( GameObjPtr, Init( GetX, GetY, flying ) );
extra^.SetDisplay( ExtraCh, ColorInv );
extra^.SetAnimSpeed( 5 );
extra^.SetScroll;
EnemyBulletList.Append( extra );
end
else
dec( ExtraRatioCtr );
end;
end;
procedure EnemyObj.HitIt( hits: byte );
var
toHit: byte;
begin
if parent = NIL then begin
if GetHits > hits then
SetHits( GetHits-hits )
else
SetStatus( killMe );
end
else
parent^.HitIt( hits );
end;
procedure EnemyObj.MoveIt;
begin
GameObj.MoveIt;
end;
(*
**-------------------------------------
** methods for EnemyBulletObj
**-------------------------------------
*)
constructor EnemyBulletObj.Init( nx, ny: PosType );
begin
GameObj.Init( nx, ny, flying );
SetSpeed( BulletSpeed[Difficulty] );
SetDisplay( 'xX', ColorStd );
SetAnimSpeed(3);
SetScroll;
end;
procedure EnemyBulletObj.MoveIt;
var
bkch: word;
begin
GameObj.MoveIt;
if parent = NIL then begin
if speedCounter <> DontMove then
DecX;
bkch := GetBackgrCh;
if ( (bkch <> goNufin)
and (bkch <> goSpace)
and (bkch <> goHillFloor) )
then
SetStatus( removeMe )
end;
end;
(*
**-------------------------------------
** methods for extdEnemyObj
**-------------------------------------
*)
constructor extdEnemyObj.Init( nx, ny: PosType; st: byte;
points: byte; hits: byte;
mvSp: speedType; shSp: speedType );
begin
EnemyObj.Init( nx, ny, st, points, hits );
MoveSpeed := mvSp; MoveCtr := MoveSpeed;
ShootSpeed := shSp; ShootCtr := ShootSpeed;
GetAdjustX := false;
GetAdjustY := false;
end;
destructor extdEnemyObj.Done;
begin
EnemyObj.Done;
end;
procedure extdEnemyObj.MoveIt;
var
i: byte;
bullet: EnemyBulletPtr;
begin
EnemyObj.MoveIt;
if ( (MoveSpeed <> DontMove) (* adjust position to player *)
and (GetStatus = flying) )
then
if MoveCtr = 0 then begin
MoveCtr := MoveSpeed;
if GetAdjustX then
if GetX < ShipBody^.GetX then
IncX
else if GetX > ShipBody^.GetX then
DecX;
if GetAdjustY then
if GetY > ShipBody^.GetY then
DecY
else if GetY < ShipBody^.GetY then
IncY;
end
else
dec( MoveCtr );
if ShootSpeed <> DontMove then (* fire enemy bullets *)
if ShootCtr = 0 then begin
ShootCtr := ShootSpeed;
for i := 1 to MaxEnemyShoot do
with ShootPos[i] do
if (dx <> NoShoot) then begin
bullet := New( EnemyBulletPtr, Init( x+dx, y+dy ) );
EnemyBulletList.Append( bullet );
end;
end
else
dec( ShootCtr );
end;
procedure extdEnemyObj.EnableAdjustX;
begin
GetAdjustX := true;
end;
procedure extdEnemyObj.EnableAdjustY;
begin
GetAdjustY := true;
end;
procedure extdEnemyObj.SetShoot( sa: ShootArr );
begin
ShootPos := sa;
end;
(*
**-------------------------------------
** methods for BaseObj
**-------------------------------------
*)
constructor BaseObj.Init(ny: PosType);
begin
EnemyObj.Init(sx, ny, flying, 1, 1);
SetDisplay( 'T', ColorInv );
SetAnimSpeed(10);
SetScroll;
end;
procedure BaseObj.HitIt( hits: byte );
begin
EnemyObj.HitIt( hits );
if GetStatus = killMe then begin
Fuel := Fuel + 20 + 5*(LevelNum-Difficulty);
if Fuel > MaxFuel then
Fuel := MaxFuel;
UpdateInfo := UpdateInfo + UpdFuel;
end;
end;
(*
**-------------------------------------
** methods for CometObj
**-------------------------------------
*)
constructor CometObj.Init(ny: PosType);
var
co: EnemyPtr;
begin
EnemyObj.Init( sx, ny, flying, 0, 100 );
SetDisplay( 'O', ColorStd );
SetSpeed( CometSpeed[ Difficulty ] );
SetScroll;
MakeBigEnemy( EnemyBulletList, @self, 3,1,1,1, 'O=-' );
end;
procedure CometObj.MoveIt;
begin
DecX;
end;
procedure CometObj.CheckXYRange;
begin
if (GetX<-3) or (GetX>sx+3) then
GameObj.CheckXYRange;
end;
(*
**-------------------------------------
** methods for UfoObj
**-------------------------------------
*)
constructor UfoObj.Init(ny: PosType);
var
co: EnemyPtr;
begin
extdEnemyObj.Init( sx, ny, flying, 5, 5,
UfMvSpeed[Difficulty], UfShSpeed[Difficulty] );
SetDisplay( '<', ColorLit );
SetSpeed( UfoSpeed[ Difficulty ] );
SetScroll;
SetShoot( UfoShoot );
EnableAdjustY;
MakeBigEnemy( EnemyList, @self, 3,3,1,2, '`/['+
'<O='+
'`\[' );
end;
procedure UfoObj.MoveIt;
begin
extdEnemyObj.MoveIt;
DecX;
end;
procedure UfoObj.CheckXYRange;
begin
if (GetX<-3) or (GetX>sx+3) then
GameObj.CheckXYRange;
end;
(*
**-------------------------------------
** methods for SeekerObj
**-------------------------------------
*)
constructor SeekerObj.Init(nx, ny: PosType);
var
co: EnemyPtr;
begin
AdjustX := ( (GameLevel>=3) or (GameScene>=UfoHangar) );
EnemyObj.Init( nx, ny, waiting, 2+ord(AdjustX), 1+ord(Difficulty>=3) );
SetSpeed( SeekerSpeed[ Difficulty ] );
SetScroll;
MoveSpeed := SeMvSpeed[Difficulty];
MoveCtr := MoveSpeed;
end;
procedure SeekerObj.MoveIt;
var
bkch: word;
dx, dy: PosType;
mlX, mlY: PosType;
mldiv: PosType;
sc : SpeedType;
begin
EnemyObj.MoveIt;
bkch := GetBackgrCh;
if ( ( (bkch=goHillFloor) and (y<MaxTopY) )
or (bkch=goHillUp) or (bkch=goHillDown)
or (bkch=goCity)
)
then
SetStatus( removeMe )
else begin
if ScrollStatus then
sc := ScrollSpeed[Difficulty]
else
sc := DontMove;
dx := GetX-ShipBody^.GetX-1;
dy := GetY-ShipBody^.GetY;
if GetType = SeekerDown then
dy := -dy;
mlX := dx*sc+ScrollCounter;
mlY := dy*SeekerSpeed[Difficulty];
if (GetStatus = waiting) then begin
if mlX <= mlY then begin
SetStatus( flying );
SetSpeed( SeekerSpeed[Difficulty] );
end;
end
else if GetStatus = flying then begin
if GetType = SeekerDown then
IncY
else
DecY;
if AdjustX then
if MoveCtr = 0 then begin
if (dy=0) or (sc=DontMove) then begin
if dx > 0 then
DecX
else if dx < 0 then
IncX
end
else if dy > 0 then begin
mldiv := (mlx*10) div mly;
if mldiv < 10 then
IncX
else if mldiv > 10 then
DecX;
end;
MoveCtr := MoveSpeed;
end
else
dec( MoveCtr );
end;
end;
end;
(*
**-------------------------------------
** methods for SeekerDownObj
**-------------------------------------
*)
constructor SeekerDownObj.Init(nx, ny: PosType);
var
co: EnemyPtr;
begin
SeekerObj.Init( nx, ny );
SetDisplay( 'V', ColorLit );
SetType( SeekerDown );
end;
(*
**-------------------------------------
** methods for SeekerUpObj
**-------------------------------------
*)
constructor SeekerUpObj.Init(nx, ny: PosType);
var
co: EnemyPtr;
begin
SeekerObj.Init( nx, ny );
SetDisplay( 'A', ColorLit );
SetType( SeekerUp );
end;
(*
**-------------------------------------
** methods for FighterObj
**-------------------------------------
*)
constructor FighterObj.Init;
var
co: EnemyPtr;
begin
extdEnemyObj.Init( sx, sy div 2, flying, 25,
(*$IFDEF TEST*)
1,
(*$ELSE*)
5+5*Difficulty,
(*$ENDIF*)
FiMvSpeed[Difficulty], FiShSpeed[Difficulty] );
SetDisplay( '<', ColorLit );
SetSpeed( FighterSpeed[ Difficulty ] );
SetScroll;
EnableAdjustY;
SetShoot( FighterShoot );
co := New( EnemyPtr, Init( 2, -2, GetStatus, 0, 0 ) );
co^.SetDisplay( '<', ColorLit );
co^.SetParent( @self );
EnemyList.Append( co );
co := New( EnemyPtr, Init( 2, 2, GetStatus, 0, 0 ) );
co^.SetDisplay( '<', ColorLit );
co^.SetParent( @self );
EnemyList.Append( co );
MakeBigEnemy( EnemyBulletList, @self,
6,7,1,4,
'```/>`'+
'```=>`'+
'`_/H\`'+
'`_OII>'+
'``\H/`'+
'```=>`'+
'```\>`');
end;
destructor FighterObj.Done;
begin
extdEnemyObj.Done;
EnableScrolling;
end;
procedure FighterObj.MoveIt;
begin
extdEnemyObj.MoveIt;
if GetX > sx-10 then
DecX;
end;
procedure FighterObj.CheckXYRange;
begin
end;
(*
**-------------------------------------
** methods for RobotObj
**-------------------------------------
*)
constructor RobotObj.Init;
var
rx, ry: PosType; (* robot position *)
i : byte; (* loop var *)
co : EnemyBulletPtr; (* help pointer to created robot mouth *)
coDisp: string;
begin
HeadDy := 0;
HeadMoveCtr := 0;
HeadMoveDir := HeadMoveUp;
rx := sx+5; (* robot position *)
ry := sy-RobotSizeY+RobotHeadSizeY-4;
extdEnemyObj.Init( rx, ry, flying, 50, (* main robot head *)
(*$IFDEF TEST*)
1,
(*$ELSE*)
2+3*Difficulty,
(*$ENDIF*)
RoMvSpeed[Difficulty], RoShSpeed[Difficulty] );
SetDisplay( 'Oo', ColorLit );
SetAnimSpeed(4);
SetSpeed( RobotSpeed[ Difficulty ] );
SetScroll;
SetShoot( RobotShoot );
(*$IFNDEF NO_HEAD*)
MakeBigEnemy( EnemyBulletList, @self,
RobotHeadSizeX, RobotHeadSizeY, 3, 4,
'``/\``'+ (* NOTE: "`" stands for: skip char *)
'`/U \`'+
'/_ >'+
'``` I'+
'\_ >'+
'``\ /`' );
coDisp := '_';
if GameLevel >= 2 then
coDisp := coDisp + '__[';
if GameLevel > LevelNum then
coDisp[3] := '[';
for i := 1 to 2 do begin (* robot mouth *)
co := New( EnemyBulletPtr, Init( -i, 0 ) );
EnemyBulletList.Append( co );
with co^ do begin
SetDisplay( coDisp, ColorStd );
SetAnimSpeed( 35-5*Difficulty );
SetScroll;
SetParent( @self );
end;
end;
(*$ENDIF*)
end;
destructor RobotObj.Done;
begin
EnemyObj.Done;
EnableScrolling;
Robot := NIL;
end;
procedure RobotObj.MoveIt;
var
enmRnd : byte;
enmXRnd: PosType;
SkDnPtr: SeekerDownPtr;
SkUpPtr: SeekerupPtr;
begin
extdEnemyObj.MoveIt;
if SceneMoveNum <= 1 then (* disable scrolling *)
DisableScrolling;
if not ScrollStatus then begin
enmRnd := Random(100); (* set seekers *)
if enmRnd < 10+Difficulty*10 then begin
(*$IFNDEF NO_ROCKET*)
enmXRnd := 2+Random( sx-RobotX-10);
SkDnPtr := New( SeekerDownPtr, Init( enmXRnd, TopY+1 ) );
SkDnPtr^.SetStatus( flying );
EnemyList.Append( SkDnPtr );
enmXRnd := 2+Random( sx-RobotX-10);
SkUpPtr := New( SeekerUpPtr, Init( enmXRnd, HillY ) );
SkUpPtr^.SetStatus( flying );
EnemyList.Append( SkUpPtr );
(*$ENDIF*)
end;
if HeadDy=0 then (* move head *)
begin
HeadMoveDir := HeadMoveUp; (* calc new directxion *)
HeadMoveCtr := 2+Random( RobotHeadSizeY-2 );
end
else if (HeadDy=RobotHeadSizeY-1) then begin
HeadMoveDir := HeadMoveDown;
HeadMoveCtr := 2+Random( RobotHeadSizeY-2 );
end;
if (HeadMoveCtr=0) then begin
HeadMoveDir := Random(3);
HeadMoveCtr := 2+Random( RobotHeadSizeY-2 );
if HeadMoveDir = HeadMoveWait then
inc( HeadMoveCtr, 15-Difficulty*3 );
end;
if HeadMoveDir = HeadMoveUp then begin (* move up/down *)
DecY;
inc( HeadDy );
end
else if HeadMoveDir = HeadMoveDown then begin
IncY;
dec( HeadDy );
end;
dec( HeadMoveCtr )
end;
end;
procedure RobotObj.CheckXYRange;
begin
end;
begin
end.