Example #1
0
 public DangerousEntity(int x, int y, Image image, bool left, PictureBox pictureBox, Frog frog, frogBox frogger)
 {
     //Sets the entity PictureBox
     this.entity = pictureBox;
     //Sets xpos
     this.xpos = x;
     //Sets ypos
     this.ypos = y;
     //Sets frog
     this.frog = frog;
     //Sets image
     this.image = image;
     //Sets left
     this.left = left;
     //Sets instance
     this.instance = frogger;
     //Sets Entity's BackgroundImage
     this.entity.BackgroundImage = image;
     //Sets Entity's BackgroundImageLayout
     this.entity.BackgroundImageLayout = ImageLayout.Stretch;
     //Determines if it is fliped left or right
     this.entity.BackgroundImage.RotateFlip(left ? RotateFlipType.Rotate90FlipNone : RotateFlipType.Rotate270FlipNone);
     //Sets startingLocationX
     this.startingLocationX = x;
     //Sets startingLocationY
     this.startingLocationY = y;
     //Moves the cars position
     changeLocation();
     //move();
     //Thread thread = new Thread(new ThreadStart(Run));
     //thread.Start();
 }
Example #2
0
 private void start_game_Click(object sender, EventArgs e)
 {
     this.Hide();
     using (frogBox frogger = new frogBox())
     {
         frogger.ShowDialog();
     }
 }
Example #3
0
        public Frog(int x, int y, PictureBox pictureBox, PictureBox endingBox, frogBox instance)
        {
            //Sets the istance
            this.instance = instance;
            //Sets the xpos
            this.xpos = x;
            //Sets the ypos
            this.ypos = y;
            //Sets the image
            this.image = SITTING_FROG;
            //Sets the frogs picturebox
            this.frog = pictureBox;
            //Sets the ending box
            this.endingBox = endingBox;

            //Stretches the background
            frog.BackgroundImageLayout = ImageLayout.Stretch;
            //Sets the frogs image
            frog.BackgroundImage = image;
            changeLocation();
        }