public static void addAnimal(Prey p) { int randomNum = Game1.m_random.Next(0, 100); if (randomNum < 50) { //place this prey on the left side p.xPosistion = 1; p.xVelocity = Math.Abs(p.xVelocity); } else { //place this prey on the right side p.xPosistion = Game1.SCREENWIDTH - 1; p.xVelocity = -1 * Math.Abs(p.xVelocity); } //Well, just add it to the list animals.Add(p); //and increment the count numAnimals = numAnimals + 1; }
//When a human prey runs offscreen, it calls this //The preyspawner will then add it to the queue of things to spawn later //Make sure that the prey is set to walk, i.e. facing the correct direction and in the correct state public static void ranOffHuman(Prey p) { //Well, just add it to the list addHuman(p); //Then remove it from the prey list, since it just ran off removals.Add(p); numRemovals = numRemovals + 1; }
public static void addImmediate(Prey p) { //Well, just add it to the list immediates.Add(p); //and increment the count numImmediates = numImmediates + 1; }