By default, the dinosaur in the image I am using in my program is facing left but if the user presses the right key, it should flip to the right and when he presses the right key repeatedly, it should move to the right. When he presses the left key when the dinosaur is facing the right, it should flip to the left and when he presses the left key, the dinosaur should move to the left. I tried the following code but it did not work.

```
    private void moveDinos(object sender, KeyEventArgs e)
    {
        bool lturn = false;

        if (e.KeyCode == Keys.Left && titlePic.Visible == false)
        {
            if (lturn == true)
                dino.Image.RotateFlip(RotateFlipType.Rotate180FlipY);
            dino.Left -= 100;
        }
        else if (e.KeyCode == Keys.Right && titlePic.Visible == false)
        {
            if (lturn == false)
                dino.Image.RotateFlip(RotateFlipType.Rotate180FlipY);
            dino.Left += 100;
        }
    }

```

I have tried many things but I can't seem to get the logic out of my mind.