void Animator_AnimationEnded(BrashMonkeySpriter.Spriter.Animation sender) { IsInteracting = false; // with = cropspot CropSpot spot = InteractWith as CropSpot; // siinä on jo maaperä if (spot.Ground != null) { IsInteracting = false; return; } spot.SetGround(new Ground()); IsInteracting = false; }
protected override void DoInteract(GameObject with, GameTime gameTime) { CropSpot spot = with as CropSpot; if (spot == null) { return; } // onko spotilla maaperää tai kasvaako siinä joku if (spot.Ground == null || spot.Ground.IsOccupied) { IsInteracting = false; return; } // ei kasva joten istutetaan spot.Ground.Plant(owner); IsInteracting = false; }