Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace BetDogsHeadFirst
- {
- public class GreyHound
- {
- public int startPosition;
- public int raceTrackLength;
- public PictureBox dogPictureBox;
- public int location = 0;
- public Random randomizer;
- public bool Run()
- {
- Random randomizer = new Random();
- int distance = randomizer.Next(1,5);
- dogPictureBox.Left = dogPictureBox.Left + distance;
- location += distance;
- if (location >= (raceTrackLength - startPosition))
- return true;
- else
- return false;
- }
- public void TakeStartingPosition()
- {
- dogPictureBox.Left = dogPictureBox.Left - location;
- location = 0;
- }
- }
- }
Add Comment
Please, Sign In to add comment