Пример #1
0
        /// <summary> *****************************
        /// Creates a new sprite List at each touch location.
        /// </summary>
        /// <param name="touches">Where the touch is</param>
        private int InsertEcoliAtTouchPosition(ReadOnlyTouchPointCollection touches)
        {
            //eventually each sprite has to be different and have it's own list? 
            int count = 0;
            foreach (TouchPoint touch in touches)
            {
                // Creates a ecoli list for each touch that has been recognized as a finger, 
                // or for any touch if finger recognition is not supported.
                        //needs to create a new list of spirtes with a n ecoli heading it and a tail behind it, with an id?
                if (touch.IsFingerRecognized || InteractiveSurface.PrimarySurfaceDevice.IsFingerRecognitionSupported == false)
                {
                    //make a new linkedlist for the ecoli and a trail
                    LinkedList<SpriteData> ecoli = new LinkedList<SpriteData>();

                        //Add a new functin? Find out what color Ecoli and display the right color sprite and color tail 
                        //?? ARE WE SITLL DOING THIS?? If it's the cleaner or the toxic one then Black or white tail? 
                   
                    //spriteOrigin = new Vector2(touch.X, touch.Y);
                    SpriteData sprite = new SpriteData(new Vector2(touch.X, touch.Y), touch.Orientation, 1.0f); //would add the color 
                    ecoli.AddLast(sprite); // always add to the end //just add? nope.

                    //Finally add LinkedList onto List of LinkedList so that it can be included when drawn
                    ecoliList.Add(ecoli);

                    //Is it helpful to be counting? 
                    count++;
                }
            }
            return count;
        }
Пример #2
0
 /// <summary> 
 /// Used to create tail and add tail segments 
 /// </summary>
 /// <param name=" "> </param>
 /// <returns></returns>
 private int InsertTrailAfterEcoli ()
 {
     int count = 0;
     //In each of the ecoli in ecoliList
     foreach (LinkedList<SpriteData> ecoli in ecoliList)
     {
         SpriteData trailColor = new SpriteData(ecoli.Last.Value.Location, ecoli.Last.Value.Orientation, 1.0f);
         ecoli.AddBefore(ecoli.Last, trailColor );
     }
     return count;
 }
Пример #3
0
 /// <summary>Not used anymore
 /// Creates a new sprite at each touch location. 
 /// </summary>
 private int InsertSpritesAtTouchPositions(ReadOnlyTouchPointCollection touches)
 {
     //eventually each sprite has to be different and have it's own list? 
     int count = 0;
     foreach (TouchPoint touch in touches)
     {
         // Create a sprite for each touch that has been recognized as a finger, 
         // or for any touch if finger recognition is not supported.
                 //needs to create a new list of spirtes with a n ecoli heading it and a tail behind it, with an id?
         if (touch.IsFingerRecognized || InteractiveSurface.PrimarySurfaceDevice.IsFingerRecognitionSupported == false)
         {
             
             //spriteOrigin = new Vector2(touch.X, touch.Y);
             SpriteData sprite = new SpriteData(new Vector2(touch.X, touch.Y), touch.Orientation, 1.0f); 
             sprites.AddLast(sprite); // always add to the end
             count++;
         }
     }
     return count;
 }