// Should be called when a player taps a critter. public void Stomped() { if (status == CritterStatus.Stompable) { status = CritterStatus.Stomped; GridDisplay.Source = stompedFace; timeRemaining = Constants.TimeToShowAsStomped; } }
private void CritterRespawned() { life = maxLife; enabled = true; birthTime = Time.time; deadTime = 0; lastTimeSienceConsumtion = Time.time; status = CritterStatus.Alive; }
public Critter(BitmapImage blankImage) { blankFace = blankImage; lifeTimer = new DispatcherTimer(); lifeTimer.Interval = TimeSpan.FromMilliseconds(Constants.TimeUnit); lifeTimer.Tick += UpdateCritter; status = CritterStatus.Empty; }
public void Initialize( Image tappedImage, BitmapImage critterImage, BitmapImage stompedImage, int timeToLive ) { GridDisplay = tappedImage; critterFace = critterImage; stompedFace = stompedImage; tappedImage.Source = critterFace; status = CritterStatus.Stompable; timeRemaining = timeToLive; lifeTimer.Start(); }
public void ResetCritter() { lifeTimer.Stop(); status = CritterStatus.Empty; GridDisplay.Source = blankFace; }
public void Overfeeded() { status = CritterStatus.Overfeeded; Die(); }
public void Starve() { status = CritterStatus.Starved; Die(); }