'C# Rotate pictureBox , I want to move the bus vertically and I cant, can you help me of coding?

using System.Drawing;
using System.Windows.Forms;

public partial class Form1 : Form {

    public bool move_right, move_left, move_up, move_down;
    public int speed = 10;
    public int score = 0;

    public Form1() { InitializeComponent(); }

    private void Form1_Load(object sender, EventArgs e)
    {
        timer1.Start();
    }

    private void timer1_Tick(object sender, EventArgs e)
    {
        if (move_left == true && pictureBox2.Left > 0) {
            pictureBox2.Left -= speed;
        }

        if (move_right == true && pictureBox2.Left < 665) {
            pictureBox2.Left += speed;
        }

        if (move_up == true && pictureBox2.Top > 0) {
            pictureBox2.Top -= speed;
        }

        if (move_down == true && pictureBox2.Top < 366) {
            pictureBox2.Top += speed;
        }
    }

    private void Form1_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.KeyCode == Keys.Left) {
            move_left = true;
        }

        if (e.KeyCode == Keys.Right) {
            move_right = true;
        }

        if (e.KeyCode == Keys.Up) {
            move_up = true;
        }

        if (e.KeyCode == Keys.Down) {
            move_down = true;
        }
    }

    private void Form1_KeyUp(object sender, KeyEventArgs e)
    {
        if (e.KeyCode == Keys.Left) {
            move_left = false;
        }

        if (e.KeyCode == Keys.Right) {
            move_right = false;
        }

        if (e.KeyCode == Keys.Up) {
            move_up = false;
        }

        if (e.KeyCode == Keys.Down) {
            move_down = false;
        }
    }
}


Solution 1:[1]

A possible solution (not the only one) is to create 3 more versions of your image with the needed orientations. You can then assign the pictures to the picturebox as needed.

That said, you would be better off drawing directly on the PictureBox. Drawing allows you to rotate the image at any angle you want and provides you more flexibility.

Ideally, you would like to use a 2D game engine instead of doing everything manually.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1