I've been following tutorial once again. Making a flappy bird clone.
According to tutorial i need to create a struct:
struct Bird
{
public float velocityY;
public float angle;
public RectangleF bird;
public Image image;
}
And then i need to create a method, that suppose to create a instance of that struct:
private void CreateBird()
{
Bird mBird;
mBird.image = imageBird;
mBird.velocityY = 0;
mBird.bird = new RectangleF(Width / 2 - birdWidth, Height / 2, birdWidth, birdHeight);
mBird.angle = 0;
}
And here's the kicker.. Nowhere in tutorial its mentioned where you need to put this method.
And for example (obvious but still) I get an error on "mBird.image" when try to do smth like this:
private void Timer1_Tick(object sender, EventArgs e)
{
DoubleBuffered = true;
Graphics g = CreateGraphics();
g.Clear(Color.DeepSkyBlue);
g.DrawImage(mBird.image, 0, 0, 100, 100);
}
Sow how can you create something like that?