forked from CartBlanche/MonoGame-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlocking.htm
executable file
·968 lines (849 loc) · 19.8 KB
/
Flocking.htm
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
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
<html xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:xanx="http://schemas.microsoft.com/developer/xanx/2005"><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"><META NAME="save" CONTENT="history"><title>Flocking Sample</title>
<style><!--
/***********************************************************
* SCRIPT-SUPPORTING STYLES
***********************************************************/
/* Defines the userData cache persistence mechanism. */
.userDataStyle
{
behavior: url(#default#userData);
}
/* Used to save the scroll bar position when navigating away from a page. */
div.saveHistory
{
behavior: url(#default#saveHistory);
}
/* Formats the expand/collapse images for all collapsible regions. */
img.toggle
{
border: 0;
margin-right: 5;
}
/* Formats the Language filter drop-down image. */
img#languageFilterImage
{
border: 0;
margin-left: 0;
vertical-align: middle;
}
/* Formats the Members Options filter drop-down image. */
img#membersOptionsFilterImage
{
border: 0;
margin-left: 0;
vertical-align: middle;
}
/* Formats the Collapse All/Expand All images. */
img#toggleAllImage
{
margin-left: 0;
vertical-align: middle;
}
/* Supports XLinks */
MSHelp\:link
{
text-decoration: underline;
color: #0000ff;
hoverColor: #3366ff;
filterString: ;
}
body
{
background: #FFFFFF;
color: #000000;
font-family: Verdana;
font-size: medium;
font-style: normal;
font-weight: normal;
margin-top: 0;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
width: 100%;
/*font-size: 110%;*/
}
div.section
{
margin-left: 15px;
}
div.hxnx5
{
margin-left: 1.5em;
}
/* Font for all headings */
h1, h2, h3, h4, h5, h6
{
font-family: Verdana, Arial, Helvetica, sans-serif;
margin-top: 18;
margin-bottom: 8;
font-weight: bold;
}
h1
{
font-size: 130%;
color: #003399;
}
div#scrollyes h1 /* Changes font size for full-scrolling topic */
{
font-size: 150%;
}
h2
{
font-size: 125%;
}
h3
{
font-size: 115%;
margin-top: 9;
margin-bottom: 4;
}
h4
{
font-size: 115%;
margin-top: 9;
margin-bottom: 4;
}
h5
{
font-size: 100%;
margin-top: 9;
margin-bottom: 4;
}
h6
{
font-size: 100%;
margin-top: 9;
margin-bottom: 4;
}
ul p, ol p, dl p
{
margin-left: 0em;
}
p
{
margin-top: .6em;
margin-bottom: .6em;
}
td p
{
margin-top: 0.0em;
margin-bottom: 0.6em;
}
dd p
{
margin-top: 0.0em;
margin-bottom: 0.6em;
}
.image
{
text-align: center;
}
dl
{
margin-top: 0em;
margin-bottom: 1.3em;
}
dd
{
margin-bottom: 0em;
margin-left: 0;
}
dl.glossary dd
{
margin-bottom: 0em;
margin-left: 1.5em;
}
dt
{
margin-top: .6em;
margin-bottom: 1;
}
ul, ol
{
margin-top: 0.6em;
margin-bottom: 0.6em;
}
ol
{
margin-left: 2.5em;
}
ul
{
margin-left: 1.9em;
}
li
{
margin-bottom: 0.4em;
}
ul ol, ol ol
{
list-style-type: lower-alpha;
}
pre
{
margin-top: .6em;
margin-bottom: .6em;
}
pre
{
font: 105% Lucida, mono;
color: #000066;
}
code
{
font-family: Monospace, Courier New, Courier;
font-size: 105%;
color: #000066;
}
table.userdata td
{
background: #ffffff;
background-color: #F5F5F5;
border-color: #ffffff;
border: none;
}
table.clsWarning
{
background: #ffffff;
padding: 0px;
margin: 0px;
border: none;
}
table.clsWarning td
{
padding: 0px;
margin: 0px;
background: #ffffff;
vertical-align: middle;
font-size: 70%;
}
div#mainSection table
{
width: 98%;
background: #ffffff;
margin-top: 5px;
margin-bottom: 5px;
}
div#mainSection table th
{
padding: 5px 6px;
background: #EFEFF7;
text-align: left;
font-size: 70%;
vertical-align: bottom;
border-bottom: 1px solid #C8CDDE;
}
div#mainSection table td
{
padding: 5px 5px;
background: #F7F7FF;
vertical-align: top;
font-size: 70%;
border-bottom: 1px solid #D5D5D3;
}
div#syntaxCodeBlocks table th
{
padding: 1px 6px;
color: #000066;
}
div#syntaxCodeBlocks table td
{
padding: 1px 5px;
}
/* Applies to the running header text in the first row of the upper table in the
non-scrolling header region. */
span#runningHeaderText
{
color: #003399;
font-size: 90%;
padding-left: 13;
}
/* Applies to the topic title in the second row of the upper table in the
non-scrolling header region. */
span#nsrTitle
{
color: #003399;
font-size: 120%;
font-weight: 600;
padding-left: 13;
}
/* Applies to everything below the non-scrolling header region. */
div#mainSection
{
font-size: 70%;
width: 100%;
}
/* Applies to everything below the non-scrolling header region, minus the footer. */
div#mainBody
{
font-size: 90%;
margin-left: 15;
margin-top: 10;
padding-bottom: 20;
}
/* Adds right padding for all blocks in mainBody */
div#mainBody p, div#mainBody ol, div#mainBody ul, div#mainBody dl
{
padding-right: 5;
}
div#mainBody div.alert, div#mainBody div.code, div#mainBody div.tableSection
{
width:98.9%;
}
div.alert p, div.code p
{
margin-top:5;
margin-bottom:8;
}
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Begin Note Styles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
div#mainSection div.alert table
{
border: 0;
}
div#mainSection div.alert table th
{
padding-top: 0;
padding-bottom: 0;
padding-left: 5;
padding-right: 5;
}
div#mainSection div.alert table td
{
padding-left: 5;
padding-right: 5;
}
img.note
{
border: 0;
margin-left: 0;
margin-right: 3;
}
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - End Note Styles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Begin Non-scrolling Header Region Styles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/* Applies to the entire non-scrolling header region. */
div#header
{
background-color: #D4DFFF;
padding-top: 0;
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
width: 100%;
}
/* Applies to both tables in the non-scrolling header region. */
div#header table
{
margin-top: 0;
margin-bottom: 0;
border-bottom-color: #C8CDDE;
border-bottom-style: solid;
border-bottom-width: 1;
background: #D4DFFF;
width: 100%;
}
/* Applies to cells in both tables in the non-scrolling header region. */
div#header table td
{
color: #0000FF;
font-size: 70%;
padding-right: 20;
padding-top: 1;
padding-bottom: 1;
border: none;
background: #D4DFFF;
}
/* Applies to the last row in the upper table of the non-scrolling header region. Text
in this row includes See Also, Constructors, Methods, and Properties. */
div#header table tr#headerTableRow3 td
{
padding-bottom: 2;
padding-top: 5;
padding-left: 15;
}
/* Applies to the lower table in the non-scrolling header region. Text in this table
includes Collapse All/Expand All, Language Filter, and Members Options. */
div#header table#bottomTable
{
border-top-color: #FFFFFF;
border-top-style: solid;
border-top-width: 1;
text-align: left;
padding-left: 15;
}
blockquote
{
margin-left: 3.8em;
margin-right: 3.8em;
margin-top: .6em;
margin-bottom: .6em;
}
sup
{
text-decoration: none;
font-size: smaller;
}
a:link
{
color: #0000FF;
/* font-weight: bold */
}
a:visited
{
color: #0000AA;
/* font-weight: bold */
}
a:hover
{
color: #3366FF;
/* font-weight: bold */
}
.label
{
font-weight: bold;
margin-top: 1em;
margin-left: -26px;
}
.tl
{
margin-bottom: .75em;
}
.atl
{
padding-left: 1.5em;
padding-bottom: .75em;
}
.cfe
{
font-weight: bold;
}
.mini
{
font-size: smaller;
}
.dt
{
margin-bottom: -.6em;
}
.indent
{
margin-left: 1.9em;
margin-right: 1.9em;
}
.product
{
text-align: right;
color: #333333;
font-size: smaller;
font-style: italic;
}
.buttonbarshade
{
position: relative;
margin: 0;
left: 0px;
top: 2;
width: 50%;
height: 40px;
}
.buttonbartable
{
position: absolute;
margin: 0;
padding:0;
border:0;
left:0px;
top: 2;
width: 100%;
height: 40px;
}
/* background color, font for header */
table.buttonbartable td, table.buttonbarshade td
{
background: #ffffff; /*#5177B8; #80C615;*/
border-left: 0px solid #80C615;
margin: 0;
padding: 0px 0px 0px 0px;
font-family: Impact, sans-serif;
font-size: 14pt;
}
table.buttonbartable td.button1
{
background: #5177B8; /*#80C615;*/;
padding: 0;
font-weight: bold;
text-align: center;
cursor: hand;
}
table.buttonbartable td.button2
{
background: #5177B8; /*#80C615;*/;
font-weight: bold;
text-align: center;
}
table.buttonbartable td.button3
{
background: #5177B8; /*#80C615;*/;
font-weight: bold;
text-align: center;
}
table.buttonbartable td.runninghead
{
padding-left: 0px;
font-style: italic;
text-align: left;
}
.version
{
text-align: left;
color: #000000;
margin-top: 3em;
margin-left: -26px;
font-size: smaller;
font-style: italic;
}
.lang, .ilang
{
color: #0000ff;
font: normal 7pt Arial, Helvetica, sans-serif;
}
div.langMenu
{
position: absolute;
z-index: 1;
width: 96pt;
padding: 8pt;
visibility: hidden;
border: 1px solid #000000;
background: #ffffd0;
}
div.langMenu ul
{
padding-left: 2em;
margin-left: 0;
}
div.filtered
{
margin: 4pt 0 8pt -26px;
padding: 4px 4px 8px 26px;
width: 100%;
border: 2px solid #aaaacc;
background: #ffffff;
}
div.filtered2
{
margin: 4pt 0 8pt -26px;
padding: 4px 4px 8px 26px;
width: 100%;
border: none;
background: #ffffff;
}
div.filtered h1, div.filtered h2, div.filtered h3, div.filtered h4
{
margin-left: -22px;
}
div.filtered span.lang
{
position: relative;
left: -22px;
}
div.reftip
{
position: absolute;
z-index: 1;
padding: 8pt;
visibility: hidden;
border: 1px solid #000000;
background: #ffffd0;
}
a.synParam
{
color: #0000FF;
/*color: #3F7800;*/
/*color: #8DC54F;*/
text-decoration: none;
font-weight: normal;
}
a.synParam:hover
{
text-decoration: underline;
font-weight: normal;
}
div.sapop
{
position: absolute;
z-index: 1;
left: 26px;
width: 100%;
padding: 10px 10px 10px 36px;
visibility: hidden;
border: 1px solid #000000;
background: #ffffd0;
}
div.footer
{
width: 100%;
border: none;
background: #ffffff;
margin-top: 18pt;
padding-bottom: 12pt;
color: #0000FF;
/*color: #228B22; */
text-align: center;
font-size: 76%;
}
div.preliminary
{
margin-top: 8pt;
padding-bottom: 12pt;
color: #A0A0A0;
}
/* A procedure section. eg. 'To create a file', 'To add a value' */
div.proc
{
margin-left: 0.5em;
}
/* The title of a 'procedure' section. */
div.proc h3
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 115%;
margin-top: 1em;
margin-bottom: 0.4em;
margin-left: -0.5em;
color: #003399;
}
div.proc ul
{
margin-left: 1.5em;
}
div.proc ol
{
margin-left: 2.0em;
}
.note
{
margin-left: 14pt;
margin-right: 12pt;
}
.indent1
{
margin-left: 12pt;
}
.indent2
{
margin-left: 24pt;
}
.indent3
{
margin-left: 36pt;
}
p.proch
{
padding-left: 16px;
}
p.proch img
{
position: relative;
vertical-align: top;
left: -18px;
margin-right: -14px;
margin-bottom: -18px;
}
div.clsPlatSpec
{
background-color:#FFF8DC;
border-style:solid;
border-width:1pt 0pt 0pt 1pt;
border-color:#ffE4C4;
margin-top:0.6em;
width:100%;
}
/* Applies to the language labels in the Language Filter drop-down list. */
.languageFilter
{
color: #0000FF;
cursor:hand;
text-decoration:underline;
padding-bottom:4;
}
/* Dropdown areas */
#languageSpan {
position: absolute;
visibility: hidden;
border-style: solid;
border-width: 1px;
border-color: #C8CDDE;
background: #d4dfff;
padding: 4px;
font-size: 70%;
}
#membersOptionsSpan {
position: absolute;
visibility: hidden;
border-style: solid;
border-width: 1px;
border-color: #C8CDDE;
background: #d4dfff;
padding: 4px;
font-size: 70%;
}
--></style>
<xml>
<MSHelp:TOCTitle Title="Flocking Sample" />
<MSHelp:RLTitle Title="Flocking Sample" />
<MSHelp:Keyword Index="A" Term="O:Microsoft.Xna.Flocking" />
<MSHelp:Keyword Index="A" Term="398f9c2c-f42f-5ea8-9bb4-ed2e946c5012" />
<MSHelp:Keyword Index="K" Term="Flocking Sample" />
<MSHelp:Attr Name="ProjType" Value="LocalProj" />
<MSHelp:Attr Name="ProjType" Value="XNA_30" />
<MSHelp:Attr Name="DocSet" Value="XNA" />
<MSHelp:Attr Name="DocSet" Value="ExpressLibVS" />
<MSHelp:Attr Name="DocSet" Value="C#" />
<MSHelp:Attr Name="Locale" Value="en-us" />
<MSHelp:Attr Name="CommunityContent" Value="1" />
<MSHelp:Attr Name="AssetID" Value="398f9c2c-f42f-5ea8-9bb4-ed2e946c5012" />
<MSHelp:Attr Name="TopicType" Value="kbOrient" />
</xml>
</head><body><div id="mainSection"><div id="mainBody">
<h1>Flocking Sample</h1>
This sample demonstrates how AIs can use simple rules to move together and create complex behaviors.
<a name="ID2EK"></a><h1 class="heading">Sample Overview</h1><div id="ID2EK" class="hxnx1">
<p>
When programming the AI for your game, you often want your actors to move and react together without having to behave identically. For example, you might want to simulate a school of fish that all swim together without a centralized control or a battalion of soldiers that can march together in formation around obstacles.
This sample demonstrates some of these behaviors. The sample has a flock of birds that fly to, and in the same direction as, other birds they see nearby. The sample also has a cat that you can turn on and who then chases the birds as they run away.
This sample is based on the Chase and Evade sample, and assumes that the reader is familiar with the code and concepts explained in that sample.
</p>
<p>This sample uses the following controls.</p>
<table>
<tr>
<th>Action</th>
<th style="width: 192px">Windows Phone</th>
<th>Windows - Keyboard Control</th>
<th>Windows/Xbox - Gamepad Control</th>
</tr>
<tr>
<td>Select the tuning parameter.</td>
<td style="width: 192px"><strong>DRAG</strong> tuning bar</td>
<td>UP ARROW, DOWN ARROW</td>
<td>D-Pad Up and Down</td>
</tr>
<tr>
<td>Increase/decrease the tuning parameter.</td>
<td style="width: 192px"><strong>DRAG </strong>tuning bar</td>
<td>LEFT ARROW, RIGHT ARROW</td>
<td>
D-Pad Left and Right, Left and Right Triggers</td>
</tr>
<tr>
<td>Reset the bird flock.</td>
<td style="width: 192px"><strong>TAP</strong> "Reset Flock" button</td>
<td>X</td>
<td>
X</td>
</tr>
<tr>
<td>Reset the tuning parameters.</td>
<td style="width: 192px"><strong>TAP</strong> "Reset Distance" button</td>
<td>B</td>
<td>B</td>
</tr>
<tr>
<td>Add/remove the cat</td>
<td style="width: 192px"><strong>TAP</strong> "Add/Remove Cat" button</td>
<td>Y</td>
<td>
Y</td>
</tr>
<tr>
<td>Move the cat.</td>
<td style="width: 192px"><strong>TAP </strong>or <strong>DRAG </strong>
on screen</td>
<td>W, S, A, D</td>
<td>
Left Thumbstick</td>
</tr>
<tr>
<td>Exit the game.</td>
<td style="width: 192px"><strong>BACK</strong></td>
<td>ESC or ALT+F4</td>
<td>
<b>BACK</b>
</td>
</tr>
</table>
</div>
</div>
<a name="ID2EHE"></a><h1 class="heading">How the Sample Works</h1><div id="ID2EHE" class="hxnx1">
<p>
</p>
<h2 class="subHeading">Flocking Behavior</h2>
<div id="ID2E1D" class="hxnx2">
<p>Flocking behavior is controlled by three simple behaviors:
cohesion, alignment, and separation. Other behaviors can be present,
but they are not required. In this sample, the birds also have a
flee behavior. </p>
<p>Cohesion is the birds’ tendency to fly together with others.
Alignment is the birds’ tendency to fly in the same direction as
other birds. Separation is the birds’ tendency to fly away from
others that are too close. Fleeing is the birds’ tendency to avoid
dangerous things. </p>
<a name="ID2ECE"></a>
<h4 class="subHeading">Cohesion</h4>
<div id="ID2ECE" class="hxnx3">
<p>Each bird flies towards others it can see. To make one bird
fly closer to another, for each other bird inside its <b>
detectionDist</b> value, the bird changes its <b>direction</b>
towards the other bird in proportion to its <b>
moveInFlockDirInfluence</b> setting and according to how close
it is to the midpoint between its <b>detectionDist</b> and <b>
separationDist</b> values. </p>
</div>
<a name="ID2EUE"></a>
<h4 class="subHeading">Alignment</h4>
<div id="ID2EUE" class="hxnx3">
<p>Each bird flies in the general direction of others it can
see. To make one bird line up with another, for each other bird
inside its <b>detectionDist</b> value, the bird adds the <b>
direction</b> the other bird is facing to its own <b>direction</b>
in proportion to its <b>moveInFlockDirInfluence</b> setting. </p>
</div>
<a name="ID2EEF"></a>
<h4 class="subHeading">Separation</h4>
<div id="ID2EEF" class="hxnx3">
<p>Each bird flies away from others that that are too close. For
each other bird inside both its <b>detectionDist</b> <i>and</i>
its <b>separationDist</b> values, the bird applies the
separation rule instead of the cohesion rule. To move one bird a
comfortable distance away from another, the bird adds the
opposite of the direction towards the other bird's direction to
its <b>direction</b> in proportion to its <b>
moveInFlockDirInfluence</b> setting and according to the ratio
of how close the other bird is relative to its <b>separationDist</b>
value. </p>
</div>
<a name="ID2EYF"></a>
<h4 class="subHeading">Flee</h4>
<div id="ID2EYF" class="hxnx3">
<p>Each bird flies away from the cat if the bird can see the
cat. To move a bird away from the cat, if the cat is inside the
bird's <b>detectionDist</b> and the bird isn't already moving
away from the cat, the bird adds the opposite of the direction
towards the cat to its <b>direction</b> value.</p>
</div>
</div>
</div>
<a name="ID2EAH"></a><h1 class="heading">Extending the Sample</h1><div id="ID2EAH" class="hxnx1">
<ul>
<li>Make one bird in the flock the leader and give it the wander
behavior from the Chase and Evade sample. Then make the other birds
in the flock follow the leader. </li>
<li>Add different colored flocks and make the birds fly with their
own kind and avoid other birds. </li>
<li>Add formations. </li>
<li>Add predator birds that chase the others.</li>
</ul>
</div>
</div><div class="footer" id="footer"><p>© 2010 Microsoft Corporation. All rights reserved.<br>Send feedback to
<a href="mailto:[email protected]?subject=Documentation Feedback: Flocking Sample">
[email protected]</a>.</p></div></div></body></html>