public void Draw(Graphics g, Player player) { if (ShootingPoints.Count > 0) { try { g.DrawCurve(shootingPen, ShootingPoints.ToArray()); g.TranslateTransform(1, 0); g.DrawCurve(shootingPen1, ShootingPoints.ToArray()); g.ResetTransform(); } catch (Exception e) { Console.WriteLine("Shot.cs-Draw-EXCEPTION : {0}", e.Message); } //STRELKA Point lastOne = (Point)ShootingPoints[ShootingPoints.Count-1]; trianglePoints = new Point[3]; trianglePoints[0] = new Point(lastOne.X - 2, lastOne.Y - 10); trianglePoints[1] = new Point(lastOne.X - 8, lastOne.Y + 2); trianglePoints[2] = new Point(lastOne.X + 4, lastOne.Y + 2); g.FillPolygon(new SolidBrush(Color.Black), trianglePoints); trianglePoints = new Point[3]; } }
public void resetShot(Player player, int height) { if (!player.isShooting) { player.isShooting = true; shootingX = player.X + 25; shootingY = height - 100; numTicks = 0; ShootingPoints = new List<Point>(); deviation = 5; } }
public void startGame() { this.Shot = new Shot(); this.Balls = new List<Ball>(); this.playerId = playerId; LevelView currentLevel = (LevelView)currentView; player = new Player(this.Width / 2, this.Height - currentLevel.statusBarImg.Height - 91, playerId); player.IsWalking = false; currentLevel.resetBalls(this.Width,this.Height); foreach (Ball b in currentLevel.Balls) { Balls.Add(b); } pbTime = new ProgressBar(10, 412, this.Width - 5, 5); finScore.Visible = false; this.timer1.Interval = INTERVAL; this.timer1.Enabled = true; this.timer1.Start(); }