Codingassignmenthelper | Home Codingassignmenthelper | Samples

Array Exercise 2–Flocking and Arrays

Array Exercise 2–Flocking and Arrays

Array Exercise 2–Flocking and Arrays

		Array Exercise 2–Flocking and Arrays
Let’s look at some examples of using arrays in our
flocking algorithms.

Try utilizing the following code in your flocking
algorithms.

Make a copy of your flocking project and try implementing the following code:
Image[] myImageArray = new Image[10];

myImageArray[0] = testImage1;
myImageArray[1]
myImageArray[2]
myImageArray[3]
myImageArray[4]
myImageArray[5]
myImageArray[6]
myImageArray[7]
myImageArray[8]
myImageArray[9]

=
=
=
=
=
=
=
=
=

testImage2;
testImage3;
testImage4;
testImage5;
testImage6;
testImage7;
testImage8;
testImage9;
testImage10;

Utils.Move_Lock_To_Grid(myImageArray[0],
TestGrid,
(10 / (double)number.Next(1, 20)) + 2,
ref testFlag1X, ref testFlag1Y);
for (int loop = 1; loop < myImageArray.Length; loop++)
{
Utils.Basic_Follow(myImageArray[loop],
myImageArray[0],
(10 / (double)number.Next(1,21)) + 1);

}

You can add more images to the array as needed……………..


		
To Download Click Here > 003 Array Exercise 2.pdf
Codingassignmenthelper | Home Codingassignmenthelper | Home