public void SwitchingPipes() { //checks if each pipe is out of the screen and resets it with diffrent highet if (Canvas.GetLeft(pipeDown1._img) < -100) { borad.Children.Remove(pipeDown1._img); borad.Children.Remove(pipeUp1._img); RandomHieghtPipes(out hieghtPipeDown, out hieghtPipeUp); pipeUp1 = new Pipes(0, 1960, "ms-appx:///Assets/pipeUP.png", hieghtPipeUp, 100); pipeDown1 = new Pipes(700 - hieghtPipeDown, 1960, "ms-appx:///Assets/pipeDown.png", hieghtPipeDown, 100); pipeDown1.Addtocanvas(borad); pipeUp1.Addtocanvas(borad); isOverPipeDown1 = false; } if (Canvas.GetLeft(pipeDown1._img) < -100) { borad.Children.Remove(pipeDown1._img); borad.Children.Remove(pipeUp1._img); RandomHieghtPipes(out hieghtPipeDown, out hieghtPipeUp); pipeUp1 = new Pipes(0, 1960, "ms-appx:///Assets/pipeUP.png", hieghtPipeUp, 100); pipeDown1 = new Pipes(700 - hieghtPipeDown, 1960, "ms-appx:///Assets/pipeDown.png", hieghtPipeDown, 100); pipeDown1.Addtocanvas(borad); pipeUp1.Addtocanvas(borad); isOverPipeDown1 = false; } if (Canvas.GetLeft(pipeDown2._img) < -100) { borad.Children.Remove(pipeDown2._img); borad.Children.Remove(pipeUp2._img); RandomHieghtPipes(out hieghtPipeDown, out hieghtPipeUp); pipeUp2 = new Pipes(0, 1960, "ms-appx:///Assets/pipeUP.png", hieghtPipeUp, 100); pipeDown2 = new Pipes(700 - hieghtPipeDown, 1960, "ms-appx:///Assets/pipeDown.png", hieghtPipeDown, 100); pipeDown2.Addtocanvas(borad); pipeUp2.Addtocanvas(borad); isOverPipeDown2 = false; } if (Canvas.GetLeft(pipeDown3._img) < -100) { borad.Children.Remove(pipeDown3._img); borad.Children.Remove(pipeUp3._img); RandomHieghtPipes(out hieghtPipeDown, out hieghtPipeUp); pipeUp3 = new Pipes(0, 1960, "ms-appx:///Assets/pipeUP.png", hieghtPipeUp, 100); pipeDown3 = new Pipes(700 - hieghtPipeDown, 1960, "ms-appx:///Assets/pipeDown.png", hieghtPipeDown, 100); pipeDown3.Addtocanvas(borad); pipeUp3.Addtocanvas(borad); isOverPipeDown3 = false; } if (Canvas.GetLeft(pipeDown4._img) < -100) { borad.Children.Remove(pipeDown4._img); borad.Children.Remove(pipeUp4._img); RandomHieghtPipes(out hieghtPipeDown, out hieghtPipeUp); pipeUp4 = new Pipes(0, 1960, "ms-appx:///Assets/pipeUP.png", hieghtPipeUp, 100); pipeDown4 = new Pipes(700 - hieghtPipeDown, 1960, "ms-appx:///Assets/pipeDown.png", hieghtPipeDown, 100); pipeDown4.Addtocanvas(borad); pipeUp4.Addtocanvas(borad); isOverPipeDown4 = false; } }
public void pipeSettings() { isBegining = true; #region Pipe settings RandomHieghtPipes(out hieghtPipeDown, out hieghtPipeUp); pipeUp1 = new Pipes(0, 1260, "ms-appx:///Assets/pipeUP.png", hieghtPipeUp, 100); pipeDown1 = new Pipes(700 - hieghtPipeDown, 1260, "ms-appx:///Assets/pipeDown.png", hieghtPipeDown, 100); pipeDown1.Addtocanvas(borad); pipeUp1.Addtocanvas(borad); RandomHieghtPipes(out hieghtPipeDown, out hieghtPipeUp); pipeUp2 = new Pipes(0, 1760, "ms-appx:///Assets/pipeUP.png", hieghtPipeUp, 100); pipeDown2 = new Pipes(700 - hieghtPipeDown, 1760, "ms-appx:///Assets/pipeDown.png", hieghtPipeDown, 100); pipeDown2.Addtocanvas(borad); pipeUp2.Addtocanvas(borad); RandomHieghtPipes(out hieghtPipeDown, out hieghtPipeUp); pipeUp3 = new Pipes(0, 2260, "ms-appx:///Assets/pipeUP.png", hieghtPipeUp, 100); pipeDown3 = new Pipes(700 - hieghtPipeDown, 2260, "ms-appx:///Assets/pipeDown.png", hieghtPipeDown, 100); pipeDown3.Addtocanvas(borad); pipeUp3.Addtocanvas(borad); RandomHieghtPipes(out hieghtPipeDown, out hieghtPipeUp); pipeUp4 = new Pipes(0, 2760, "ms-appx:///Assets/pipeUP.png", hieghtPipeUp, 100); pipeDown4 = new Pipes(700 - hieghtPipeDown, 2760, "ms-appx:///Assets/pipeDown.png", hieghtPipeDown, 100); pipeDown4.Addtocanvas(borad); pipeUp4.Addtocanvas(borad); #endregion }